Use position to identify txns at same txid

This commit is contained in:
Aditya Kulkarni 2020-04-11 18:18:52 -07:00
parent 99c81bc130
commit d0e7a5f635

View File

@ -754,10 +754,12 @@ impl LightClient {
// For each sapling note that is not a change, add a Tx. // For each sapling note that is not a change, add a Tx.
txns.extend(v.notes.iter() txns.extend(v.notes.iter()
.filter( |nd| !nd.is_change ) .filter( |nd| !nd.is_change )
.map ( |nd| .enumerate()
.map ( |(i, nd)|
object! { object! {
"block_height" => v.block, "block_height" => v.block,
"datetime" => v.datetime, "datetime" => v.datetime,
"position" => i,
"txid" => format!("{}", v.txid), "txid" => format!("{}", v.txid),
"amount" => nd.note.value as i64, "amount" => nd.note.value as i64,
"address" => LightWallet::note_address(self.config.hrp_sapling_address(), nd), "address" => LightWallet::note_address(self.config.hrp_sapling_address(), nd),