File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -5902,10 +5902,17 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
59025902
59035903 /// Filters a block's `txdata` for transactions spending watched outputs or for any child
59045904 /// transactions thereof.
5905+ /// While iterating, this also tracks whether we observed the funding transaction.
59055906 #[ rustfmt:: skip]
5906- fn filter_block < ' a > ( & self , txdata : & TransactionData < ' a > ) -> Vec < & ' a Transaction > {
5907+ fn filter_block < ' a > ( & mut self , txdata : & TransactionData < ' a > ) -> Vec < & ' a Transaction > {
59075908 let mut matched_txn = new_hash_set ( ) ;
59085909 txdata. iter ( ) . filter ( |& & ( _, tx) | {
5910+ let txid = tx. compute_txid ( ) ;
5911+ if !self . funding_seen_onchain && ( txid == self . funding . funding_txid ( ) ||
5912+ self . pending_funding . iter ( ) . any ( |f| f. funding_txid ( ) == txid) )
5913+ {
5914+ self . funding_seen_onchain = true ;
5915+ }
59095916 let mut matches = self . spends_watched_output ( tx) ;
59105917 for input in tx. input . iter ( ) {
59115918 if matches { break ; }
@@ -5914,7 +5921,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
59145921 }
59155922 }
59165923 if matches {
5917- matched_txn. insert ( tx . compute_txid ( ) ) ;
5924+ matched_txn. insert ( txid ) ;
59185925 }
59195926 matches
59205927 } ) . map ( |( _, tx) | * tx) . collect ( )
You can’t perform that action at this time.
0 commit comments