@@ -1343,17 +1343,24 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
1343
1343
/// Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
1344
1344
/// calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
1345
1345
/// have been registered.
1346
- pub fn load_outputs_to_watch < F : Deref > ( & self , filter : & F ) where F :: Target : chain:: Filter {
1346
+ pub fn load_outputs_to_watch < F : Deref , L : Deref > ( & self , filter : & F , logger : & L )
1347
+ where
1348
+ F :: Target : chain:: Filter , L :: Target : Logger ,
1349
+ {
1347
1350
let lock = self . inner . lock ( ) . unwrap ( ) ;
1348
1351
filter. register_tx ( & lock. get_funding_txo ( ) . 0 . txid , & lock. get_funding_txo ( ) . 1 ) ;
1352
+ log_trace ! ( logger,
1353
+ "Registering funding outpoint {}" , & lock. get_funding_txo( ) . 0 ) ;
1349
1354
for ( txid, outputs) in lock. get_outputs_to_watch ( ) . iter ( ) {
1350
1355
for ( index, script_pubkey) in outputs. iter ( ) {
1351
1356
assert ! ( * index <= u16 :: max_value( ) as u32 ) ;
1357
+ let outpoint = OutPoint { txid : * txid, index : * index as u16 } ;
1352
1358
filter. register_output ( WatchedOutput {
1353
1359
block_hash : None ,
1354
- outpoint : OutPoint { txid : * txid , index : * index as u16 } ,
1360
+ outpoint : outpoint ,
1355
1361
script_pubkey : script_pubkey. clone ( ) ,
1356
1362
} ) ;
1363
+ log_trace ! ( logger, "Adding monitoring for spends of outpoint {} to the filter" , outpoint) ;
1357
1364
}
1358
1365
}
1359
1366
}
@@ -3392,9 +3399,11 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
3392
3399
3393
3400
if height > self . best_block . height ( ) {
3394
3401
self . best_block = BestBlock :: new ( block_hash, height) ;
3402
+ log_trace ! ( logger, "Connecting new block {} at height {}" , block_hash, height) ;
3395
3403
self . block_confirmed ( height, block_hash, vec ! [ ] , vec ! [ ] , vec ! [ ] , & broadcaster, & fee_estimator, & logger)
3396
3404
} else if block_hash != self . best_block . block_hash ( ) {
3397
3405
self . best_block = BestBlock :: new ( block_hash, height) ;
3406
+ log_trace ! ( logger, "New block of block hash {} has been found and updated" , block_hash) ;
3398
3407
self . onchain_events_awaiting_threshold_conf . retain ( |ref entry| entry. height <= height) ;
3399
3408
self . onchain_tx_handler . block_disconnected ( height + 1 , broadcaster, fee_estimator, logger) ;
3400
3409
Vec :: new ( )
@@ -3431,6 +3440,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
3431
3440
let mut claimable_outpoints = Vec :: new ( ) ;
3432
3441
' tx_iter: for tx in & txn_matched {
3433
3442
let txid = tx. txid ( ) ;
3443
+ log_trace ! ( logger, "Transaction id {} confirmed in block {}" , txid , block_hash) ;
3434
3444
// If a transaction has already been confirmed, ensure we don't bother processing it duplicatively.
3435
3445
if Some ( txid) == self . funding_spend_confirmed {
3436
3446
log_debug ! ( logger, "Skipping redundant processing of funding-spend tx {} as it was previously confirmed" , txid) ;
0 commit comments