From 2ea34e16cb09d89bd2d80c87a78341584486d9c2 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Sun, 13 Oct 2019 10:34:53 -0700 Subject: [PATCH] Fix verified bal off issue --- lib/src/lightwallet.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/lightwallet.rs b/lib/src/lightwallet.rs index b795f59..2d8c79c 100644 --- a/lib/src/lightwallet.rs +++ b/lib/src/lightwallet.rs @@ -529,7 +529,7 @@ impl LightWallet { pub fn verified_zbalance(&self, addr: Option) -> u64 { let anchor_height = match self.get_target_height_and_anchor_offset() { - Some((height, anchor_offset)) => height - anchor_offset as u32, + Some((height, anchor_offset)) => height - anchor_offset as u32 - 1, None => return 0, }; @@ -1082,7 +1082,7 @@ impl LightWallet { self.config.base58_script_address()) { Some(to) => to, None => { - let e = format!("Invalid recipient address: {}", to.0); + let e = format!("Invalid recipient address: '{}'", to.0); error!("{}", e); return Err(e); } @@ -1175,7 +1175,7 @@ impl LightWallet { if selected_value < u64::from(target_value) { let e = format!( - "Insufficient verified funds (have {}, need {:?}).\n Note, funds need {} confirmations before they can be spent", + "Insufficient verified funds (have {}, need {:?}).\nNote: funds need {} confirmations before they can be spent", selected_value, target_value, self.config.anchor_offset ); error!("{}", e);