Skip to content

Commit bbceb09

Browse files
committed
Log confirmation of channel funding transaction
1 parent 98e5cbc commit bbceb09

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

lightning/src/ln/channel.rs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5063,10 +5063,13 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
50635063
self.get_initial_counterparty_commitment_signature(funding, logger)
50645064
}
50655065

5066-
fn check_for_funding_tx_confirmed(
5066+
fn check_for_funding_tx_confirmed<L: Deref>(
50675067
&mut self, funding: &mut FundingScope, block_hash: &BlockHash, height: u32,
5068-
index_in_block: usize, tx: &mut ConfirmedTransaction,
5069-
) -> Result<bool, ClosureReason> {
5068+
index_in_block: usize, tx: &mut ConfirmedTransaction, logger: &L,
5069+
) -> Result<bool, ClosureReason>
5070+
where
5071+
L::Target: Logger,
5072+
{
50705073
let funding_txo = match funding.get_funding_txo() {
50715074
Some(funding_txo) => funding_txo,
50725075
None => {
@@ -5116,6 +5119,14 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
51165119
Err(_) => panic!("Block was bogus - either height was > 16 million, had > 16 million transactions, or had > 65k outputs"),
51175120
};
51185121

5122+
log_info!(
5123+
logger,
5124+
"Funding txid {} for channel {} confirmed in block {}",
5125+
funding_txo.txid,
5126+
&self.channel_id(),
5127+
block_hash,
5128+
);
5129+
51195130
return Ok(true);
51205131
}
51215132
}
@@ -8686,7 +8697,7 @@ impl<SP: Deref> FundedChannel<SP> where
86868697
// and send it immediately instead of waiting for a best_block_updated call (which may have
86878698
// already happened for this block).
86888699
let is_funding_tx_confirmed = self.context.check_for_funding_tx_confirmed(
8689-
&mut self.funding, block_hash, height, index_in_block, &mut confirmed_tx,
8700+
&mut self.funding, block_hash, height, index_in_block, &mut confirmed_tx, logger,
86908701
)?;
86918702

86928703
if is_funding_tx_confirmed {
@@ -8718,7 +8729,7 @@ impl<SP: Deref> FundedChannel<SP> where
87188729
#[cfg(splicing)]
87198730
for (index, funding) in self.pending_funding.iter_mut().enumerate() {
87208731
if self.context.check_for_funding_tx_confirmed(
8721-
funding, block_hash, height, index_in_block, &mut confirmed_tx,
8732+
funding, block_hash, height, index_in_block, &mut confirmed_tx, logger,
87228733
)? {
87238734
if funding_already_confirmed || confirmed_funding_index.is_some() {
87248735
let err_reason = "splice tx of another pending funding already confirmed";

0 commit comments

Comments
 (0)