diff --git a/lightning/src/chain/chainmonitor.rs b/lightning/src/chain/chainmonitor.rs index fef1e3bf14f..15f6f3f48e1 100644 --- a/lightning/src/chain/chainmonitor.rs +++ b/lightning/src/chain/chainmonitor.rs @@ -700,7 +700,7 @@ where C::Target: chain::Filter, } } if let Some(ref chain_source) = self.chain_source { - monitor.load_outputs_to_watch(chain_source); + monitor.load_outputs_to_watch(chain_source, &self.logger); } entry.insert(MonitorHolder { monitor, diff --git a/lightning/src/chain/channelmonitor.rs b/lightning/src/chain/channelmonitor.rs index 47f5605edbb..7c747c6432f 100644 --- a/lightning/src/chain/channelmonitor.rs +++ b/lightning/src/chain/channelmonitor.rs @@ -1349,7 +1349,15 @@ impl ChannelMonitor { /// Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly /// calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs /// have been registered. - pub fn load_outputs_to_watch(&self, filter: &F) where F::Target: chain::Filter { + pub fn load_outputs_to_watch( + &self, + filter: &F, + logger: &L, + ) + where + F::Target: chain::Filter, + L::Target: Logger, + { let lock = self.inner.lock().unwrap(); filter.register_tx(&lock.get_funding_txo().0.txid, &lock.get_funding_txo().1); for (txid, outputs) in lock.get_outputs_to_watch().iter() { @@ -1360,6 +1368,7 @@ impl ChannelMonitor { outpoint: OutPoint { txid: *txid, index: *index as u16 }, script_pubkey: script_pubkey.clone(), }); + log_trace!(logger, "Adding txid {} to the filter", txid); } } } @@ -3312,9 +3321,11 @@ impl ChannelMonitorImpl { if height > self.best_block.height() { self.best_block = BestBlock::new(block_hash, height); + log_trace!(logger, "New best_block of height {} has been found and updated", height); self.block_confirmed(height, block_hash, vec![], vec![], vec![], &broadcaster, &fee_estimator, &logger) } else if block_hash != self.best_block.block_hash() { self.best_block = BestBlock::new(block_hash, height); + log_trace!(logger, "New best_block of block hash {} has been found and updated", block_hash); self.onchain_events_awaiting_threshold_conf.retain(|ref entry| entry.height <= height); self.onchain_tx_handler.block_disconnected(height + 1, broadcaster, fee_estimator, logger); Vec::new() @@ -3351,6 +3362,7 @@ impl ChannelMonitorImpl { let mut claimable_outpoints = Vec::new(); 'tx_iter: for tx in &txn_matched { let txid = tx.txid(); + log_trace!(logger, "Transaction id {} confirmed in block {}", txid , block_hash); // If a transaction has already been confirmed, ensure we don't bother processing it duplicatively. if Some(txid) == self.funding_spend_confirmed { log_debug!(logger, "Skipping redundant processing of funding-spend tx {} as it was previously confirmed", txid); diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 3ea9301007b..f1f7a8a58e6 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -7009,6 +7009,12 @@ where let timestamp = self.highest_seen_timestamp.load(Ordering::Acquire); self.do_chain_event(Some(last_best_block_height), |channel| channel.best_block_updated(last_best_block_height, timestamp as u32, self.genesis_hash.clone(), &self.node_signer, &self.default_configuration, &self.logger)); } + // log each confirmed tansaction's Txid. + for tx in txdata.iter() { + let (index, transaction) = tx; + let txid = transaction.txid(); + log_trace!(self.logger, "Transaction id {} confirmed in block {}", txid, block_hash); + } } fn best_block_updated(&self, header: &BlockHeader, height: u32) {