Browse Source

Fix total spent

master
Aditya Kulkarni 5 years ago
parent
commit
a2c45646d7
  1. 2
      rust-lightclient/src/lightclient.rs
  2. 4
      rust-lightclient/src/lightwallet.rs

2
rust-lightclient/src/lightclient.rs

@ -139,6 +139,8 @@ impl LightClient {
_ => "".to_string() _ => "".to_string()
}); });
}); });
println!("Total spent: {}", v.total_shielded_value_spent);
} }
) )
} }

4
rust-lightclient/src/lightwallet.rs

@ -672,12 +672,12 @@ impl LightWallet {
block: block_data.height, block: block_data.height,
txid: tx.txid, txid: tx.txid,
notes: vec![], notes: vec![],
total_shielded_value_spent total_shielded_value_spent: 0
}; };
txs.insert(tx.txid, tx_entry); txs.insert(tx.txid, tx_entry);
} }
let tx_entry = txs.get_mut(&tx.txid).unwrap(); let tx_entry = txs.get_mut(&tx.txid).unwrap();
tx_entry.total_shielded_value_spent = total_shielded_value_spent;
// Save notes. // Save notes.
for output in tx for output in tx
.shielded_outputs .shielded_outputs

Loading…
Cancel
Save