Support for Pirate Coin

This commit is contained in:
Hanh 2022-09-09 23:08:49 +08:00
parent e530ac1104
commit a29a4eb0f5
5 changed files with 7 additions and 2 deletions

View File

@ -4,4 +4,5 @@ allow_send = true
yec = { db_path = "./yec.db", lwd_url = "https://lite.ycash.xyz:9067" }
zec = { db_path = "./zec.db", lwd_url = "https://lwdv3.zecwallet.co:443" }
arrr = { db_path = "./arrr.db", lwd_url = "https://lightd1.pirate.black:9067" }
# zec = { db_path = "./zec.db", lwd_url = "https://zuul.free2z.cash:9067" }

View File

@ -53,7 +53,7 @@ fn new_account_with_key(coin: u8, name: &str, key: &str, index: u32) -> anyhow::
let db = c.db()?;
let (account, exists) =
db.store_account(name, seed.as_deref(), index, sk.as_deref(), &ivk, &pa)?;
if !exists {
if !exists && c.chain.has_transparent() {
db.create_taddr(account)?;
}
Ok(account)

View File

@ -110,6 +110,7 @@ pub unsafe extern "C" fn init_wallet(db_path: *mut c_char) {
from_c_str!(db_path);
let _ = init_coin(0, &format!("{}/zec.db", &db_path));
let _ = init_coin(1, &format!("{}/yec.db", &db_path));
let _ = init_coin(2, &format!("{}/arrr.db", &db_path));
}
#[no_mangle]

View File

@ -10,9 +10,10 @@ use zcash_params::{OUTPUT_PARAMS, SPEND_PARAMS};
use zcash_proofs::prover::LocalTxProver;
lazy_static! {
pub static ref COIN_CONFIG: [Mutex<CoinConfig>; 2] = [
pub static ref COIN_CONFIG: [Mutex<CoinConfig>; 3] = [
Mutex::new(CoinConfig::new(0, CoinType::Zcash)),
Mutex::new(CoinConfig::new(1, CoinType::Ycash)),
Mutex::new(CoinConfig::new(2, CoinType::PirateChain)),
];
pub static ref PROVER: AtomicLazyCell<LocalTxProver> = AtomicLazyCell::new();
pub static ref RAPTORQ: Mutex<FountainCodes> = Mutex::new(FountainCodes::new());

View File

@ -70,6 +70,8 @@ async fn main() -> anyhow::Result<()> {
init(0, zec)?;
let yec: HashMap<String, String> = figment.extract_inner("yec")?;
init(1, yec)?;
let arrr: HashMap<String, String> = figment.extract_inner("arrr")?;
init(2, arrr)?;
warp_api_ffi::set_active_account(0, 1);
warp_api_ffi::set_active(0);