mirror of
https://github.com/Qortal/piratewallet-light-cli.git
synced 2025-02-12 02:05:47 +00:00
Add bug warning
This commit is contained in:
parent
085b8492ba
commit
c1dd259caf
@ -42,6 +42,18 @@ pub struct LightClientConfig {
|
|||||||
|
|
||||||
impl LightClientConfig {
|
impl LightClientConfig {
|
||||||
|
|
||||||
|
// Create an unconnected (to any server) config to test for local wallet etc...
|
||||||
|
pub fn create_unconnected(chain_name: String) -> LightClientConfig {
|
||||||
|
LightClientConfig {
|
||||||
|
server : http::Uri::default(),
|
||||||
|
chain_name : chain_name,
|
||||||
|
sapling_activation_height : 0,
|
||||||
|
consensus_branch_id : "".to_string(),
|
||||||
|
anchor_offset : ANCHOR_OFFSET,
|
||||||
|
no_cert_verification : false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn create(server: http::Uri, dangerous: bool) -> io::Result<(LightClientConfig, u64)> {
|
pub fn create(server: http::Uri, dangerous: bool) -> io::Result<(LightClientConfig, u64)> {
|
||||||
// Do a getinfo first, before opening the wallet
|
// Do a getinfo first, before opening the wallet
|
||||||
let info = grpcconnector::get_info(server.clone(), dangerous)
|
let info = grpcconnector::get_info(server.clone(), dangerous)
|
||||||
@ -255,6 +267,12 @@ impl LightClient {
|
|||||||
info!("Read wallet with birthday {}", lc.wallet.read().unwrap().get_first_tx_block());
|
info!("Read wallet with birthday {}", lc.wallet.read().unwrap().get_first_tx_block());
|
||||||
info!("Created LightClient to {}", &config.server);
|
info!("Created LightClient to {}", &config.server);
|
||||||
|
|
||||||
|
if crate::lightwallet::bugs::BugBip39Derivation::has_bug(&lc) {
|
||||||
|
let m = format!("WARNING!!!\nYour wallet has a bip39derivation bug that's showing incorrect addresses.\nPlease run 'fixbip39bug' to automatically fix the address derivation in your wallet!\nPlease see: https://github.com/adityapk00/zecwallet-light-cli/blob/master/bip39bug.md");
|
||||||
|
info!("{}", m);
|
||||||
|
println!("{}", m);
|
||||||
|
}
|
||||||
|
|
||||||
Ok(lc)
|
Ok(lc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,6 +70,7 @@ impl BugBip39Derivation {
|
|||||||
|
|
||||||
// Tranfer money
|
// Tranfer money
|
||||||
// 1. The desination is z address #0
|
// 1. The desination is z address #0
|
||||||
|
println!("Sending funds to ourself.");
|
||||||
let zaddr = client.do_address()["z_addresses"][0].as_str().unwrap().to_string();
|
let zaddr = client.do_address()["z_addresses"][0].as_str().unwrap().to_string();
|
||||||
let balance_json = client.do_balance();
|
let balance_json = client.do_balance();
|
||||||
let fee: u64 = DEFAULT_FEE.try_into().unwrap();
|
let fee: u64 = DEFAULT_FEE.try_into().unwrap();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user