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 @@ -5818,10 +5818,17 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
5818
5818
5819
5819
/// Filters a block's `txdata` for transactions spending watched outputs or for any child
5820
5820
/// transactions thereof.
5821
+ /// While iterating, this also tracks whether we observed the funding transaction.
5821
5822
#[ rustfmt:: skip]
5822
- fn filter_block < ' a > ( & self , txdata : & TransactionData < ' a > ) -> Vec < & ' a Transaction > {
5823
+ fn filter_block < ' a > ( & mut self , txdata : & TransactionData < ' a > ) -> Vec < & ' a Transaction > {
5823
5824
let mut matched_txn = new_hash_set ( ) ;
5824
5825
txdata. iter ( ) . filter ( |& & ( _, tx) | {
5826
+ let txid = tx. compute_txid ( ) ;
5827
+ if !self . funding_seen_onchain && ( txid == self . funding . funding_txid ( ) ||
5828
+ self . pending_funding . iter ( ) . any ( |f| f. funding_txid ( ) == txid) )
5829
+ {
5830
+ self . funding_seen_onchain = true ;
5831
+ }
5825
5832
let mut matches = self . spends_watched_output ( tx) ;
5826
5833
for input in tx. input . iter ( ) {
5827
5834
if matches { break ; }
@@ -5830,7 +5837,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
5830
5837
}
5831
5838
}
5832
5839
if matches {
5833
- matched_txn. insert ( tx . compute_txid ( ) ) ;
5840
+ matched_txn. insert ( txid ) ;
5834
5841
}
5835
5842
matches
5836
5843
} ) . map ( |( _, tx) | * tx) . collect ( )
You can’t perform that action at this time.
0 commit comments