@@ -1382,15 +1382,22 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
13821382 /// Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
13831383 /// calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
13841384 /// have been registered.
1385- pub fn load_outputs_to_watch < F : Deref > ( & self , filter : & F ) where F :: Target : chain:: Filter {
1385+ pub fn load_outputs_to_watch < F : Deref , L : Deref > ( & self , filter : & F , logger : & L )
1386+ where
1387+ F :: Target : chain:: Filter , L :: Target : Logger ,
1388+ {
13861389 let lock = self . inner . lock ( ) . unwrap ( ) ;
1390+ let logger = WithChannelMonitor :: from_impl ( logger, & * lock) ;
1391+ log_trace ! ( & logger, "Registering funding outpoint {}" , & lock. get_funding_txo( ) . 0 ) ;
13871392 filter. register_tx ( & lock. get_funding_txo ( ) . 0 . txid , & lock. get_funding_txo ( ) . 1 ) ;
13881393 for ( txid, outputs) in lock. get_outputs_to_watch ( ) . iter ( ) {
13891394 for ( index, script_pubkey) in outputs. iter ( ) {
13901395 assert ! ( * index <= u16 :: max_value( ) as u32 ) ;
1396+ let outpoint = OutPoint { txid : * txid, index : * index as u16 } ;
1397+ log_trace ! ( logger, "Registering outpoint {} with the filter for monitoring spends" , outpoint) ;
13911398 filter. register_output ( WatchedOutput {
13921399 block_hash : None ,
1393- outpoint : OutPoint { txid : * txid , index : * index as u16 } ,
1400+ outpoint,
13941401 script_pubkey : script_pubkey. clone ( ) ,
13951402 } ) ;
13961403 }
@@ -3458,9 +3465,11 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
34583465
34593466 if height > self . best_block . height ( ) {
34603467 self . best_block = BestBlock :: new ( block_hash, height) ;
3468+ log_trace ! ( logger, "Connecting new block {} at height {}" , block_hash, height) ;
34613469 self . block_confirmed ( height, block_hash, vec ! [ ] , vec ! [ ] , vec ! [ ] , & broadcaster, & fee_estimator, logger)
34623470 } else if block_hash != self . best_block . block_hash ( ) {
34633471 self . best_block = BestBlock :: new ( block_hash, height) ;
3472+ log_trace ! ( logger, "Best block re-orged, replaced with new block {} at height {}" , block_hash, height) ;
34643473 self . onchain_events_awaiting_threshold_conf . retain ( |ref entry| entry. height <= height) ;
34653474 self . onchain_tx_handler . block_disconnected ( height + 1 , broadcaster, fee_estimator, logger) ;
34663475 Vec :: new ( )
@@ -3497,6 +3506,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
34973506 let mut claimable_outpoints = Vec :: new ( ) ;
34983507 ' tx_iter: for tx in & txn_matched {
34993508 let txid = tx. txid ( ) ;
3509+ log_trace ! ( logger, "Transaction {} confirmed in block {}" , txid , block_hash) ;
35003510 // If a transaction has already been confirmed, ensure we don't bother processing it duplicatively.
35013511 if Some ( txid) == self . funding_spend_confirmed {
35023512 log_debug ! ( logger, "Skipping redundant processing of funding-spend tx {} as it was previously confirmed" , txid) ;
0 commit comments