File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ define_entity_info!(Wallet, {
5151 /// Set of multi-party payjoin sessions that this wallet is participating in
5252 pub ( crate ) active_multi_party_payjoins: HashMap <BulletinBoardId , MultiPartyPayjoinSession >,
5353 /// UTXOs registered in the order book by this wallet
54- // TODO: this should be moved to wallet data
5554 pub ( crate ) registered_inputs: OrdSet <Outpoint >,
5655 }
5756) ;
@@ -439,13 +438,21 @@ impl<'a> WalletHandleMut<'a> {
439438 if self . info ( ) . registered_inputs . contains ( outpoint) {
440439 return ;
441440 }
442- self . info_mut ( ) . registered_inputs . insert ( * outpoint) ;
441+ let mut latest_info = self . info ( ) . clone ( ) ;
442+ latest_info. registered_inputs . insert ( * outpoint) ;
443+ self . update_info ( latest_info) ;
443444 info ! (
444445 "Wallet {:?} registered input {:?} in order book" ,
445446 self . id, outpoint
446447 ) ;
447448 }
448449
450+ pub ( crate ) fn update_info ( & mut self , info : WalletInfo ) {
451+ let id = WalletInfoId ( self . sim . wallet_info . len ( ) ) ;
452+ self . sim . wallet_info . push ( info) ;
453+ self . data_mut ( ) . last_wallet_info_id = id;
454+ }
455+
449456 pub ( crate ) fn do_action ( & ' a mut self , action : & Action ) {
450457 match action {
451458 Action :: Wait => { }
You can’t perform that action at this time.
0 commit comments