From 427ceab79669520c624ea4fe4b05737506a079d7 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sat, 12 Oct 2024 21:31:14 +0200 Subject: [PATCH] wallet: add information about number of our inputs to the history --- src/rows.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/rows.rs b/src/rows.rs index 462e87d..f2a670d 100644 --- a/src/rows.rs +++ b/src/rows.rs @@ -109,6 +109,7 @@ pub struct TxRow { pub height: TxStatus, // TODO: Add date/time pub operation: OpType, + pub our_inputs: Vec, pub counterparties: Vec<(Counterparty, i64)>, pub own: Vec<(DerivedAddr, i64)>, pub txid: Txid, @@ -164,6 +165,12 @@ impl WalletCache { let mut row = TxRow { height: tx.status.map(|info| info.height), operation: OpType::Credit, + our_inputs: tx + .inputs + .iter() + .enumerate() + .filter_map(|(idx, inp)| inp.derived_addr().map(|_| idx as u32)) + .collect(), counterparties: none!(), own: none!(), txid: tx.txid,