@@ -13,7 +13,10 @@ use crate::wallet::managed_wallet_info::transaction_building::{
1313use crate :: wallet:: managed_wallet_info:: TransactionRecord ;
1414use crate :: wallet:: ManagedWalletInfo ;
1515use crate :: { Network , Utxo , Wallet , WalletBalance } ;
16+ use dashcore:: blockdata:: transaction:: OutPoint ;
1617use dashcore:: { Address as DashAddress , Address , Transaction } ;
18+
19+ use crate :: account:: ManagedAccountTrait ;
1720use std:: collections:: BTreeSet ;
1821
1922/// Trait that wallet info types must implement to work with WalletManager
@@ -272,6 +275,17 @@ impl WalletInfoInterface for ManagedWalletInfo {
272275 false , // Not ours (we received)
273276 ) ;
274277 account. transactions . insert ( tx. txid , tx_record) ;
278+
279+ // Add UTXOs for outputs that belong to this account
280+ let account_addresses: BTreeSet < Address > =
281+ account. all_addresses ( ) . into_iter ( ) . collect ( ) ;
282+ account. add_utxos_from_transaction (
283+ & tx. transaction ,
284+ & account_addresses,
285+ network,
286+ tx. height ,
287+ true ,
288+ ) ;
275289 }
276290 }
277291
@@ -289,6 +303,17 @@ impl WalletInfoInterface for ManagedWalletInfo {
289303 false ,
290304 ) ;
291305 account. transactions . insert ( tx. txid , tx_record) ;
306+
307+ // Add UTXOs for outputs that belong to this account
308+ let account_addresses: BTreeSet < Address > =
309+ account. all_addresses ( ) . into_iter ( ) . collect ( ) ;
310+ account. add_utxos_from_transaction (
311+ & tx. transaction ,
312+ & account_addresses,
313+ network,
314+ tx. height ,
315+ true ,
316+ ) ;
292317 }
293318 }
294319
@@ -305,6 +330,17 @@ impl WalletInfoInterface for ManagedWalletInfo {
305330 false ,
306331 ) ;
307332 account. transactions . insert ( tx. txid , tx_record) ;
333+
334+ // Add UTXOs for outputs that belong to this account
335+ let account_addresses: BTreeSet < Address > =
336+ account. all_addresses ( ) . into_iter ( ) . collect ( ) ;
337+ account. add_utxos_from_transaction (
338+ & tx. transaction ,
339+ & account_addresses,
340+ network,
341+ tx. height ,
342+ true ,
343+ ) ;
308344 }
309345 }
310346 }
0 commit comments