Skip to content

Commit db2c5e8

Browse files
committed
Log confirmation of channel funding transaction
1 parent 17c6971 commit db2c5e8

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
@@ -5315,10 +5315,13 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
53155315
self.get_initial_counterparty_commitment_signature(funding, logger)
53165316
}
53175317

5318-
fn check_for_funding_tx_confirmed(
5318+
fn check_for_funding_tx_confirmed<L: Deref>(
53195319
&mut self, funding: &mut FundingScope, block_hash: &BlockHash, height: u32,
5320-
index_in_block: usize, tx: &mut ConfirmedTransaction,
5321-
) -> Result<bool, ClosureReason> {
5320+
index_in_block: usize, tx: &mut ConfirmedTransaction, logger: &L,
5321+
) -> Result<bool, ClosureReason>
5322+
where
5323+
L::Target: Logger,
5324+
{
53225325
let funding_txo = match funding.get_funding_txo() {
53235326
Some(funding_txo) => funding_txo,
53245327
None => {
@@ -5368,6 +5371,14 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
53685371
Err(_) => panic!("Block was bogus - either height was > 16 million, had > 16 million transactions, or had > 65k outputs"),
53695372
};
53705373

5374+
log_info!(
5375+
logger,
5376+
"Funding txid {} for channel {} confirmed in block {}",
5377+
funding_txo.txid,
5378+
&self.channel_id(),
5379+
block_hash,
5380+
);
5381+
53715382
return Ok(true);
53725383
}
53735384
}
@@ -8805,7 +8816,7 @@ impl<SP: Deref> FundedChannel<SP> where
88058816
// and send it immediately instead of waiting for a best_block_updated call (which may have
88068817
// already happened for this block).
88078818
let is_funding_tx_confirmed = self.context.check_for_funding_tx_confirmed(
8808-
&mut self.funding, block_hash, height, index_in_block, &mut confirmed_tx,
8819+
&mut self.funding, block_hash, height, index_in_block, &mut confirmed_tx, logger,
88098820
)?;
88108821

88118822
if is_funding_tx_confirmed {
@@ -8837,7 +8848,7 @@ impl<SP: Deref> FundedChannel<SP> where
88378848
#[cfg(splicing)]
88388849
for (index, funding) in self.pending_funding.iter_mut().enumerate() {
88398850
if self.context.check_for_funding_tx_confirmed(
8840-
funding, block_hash, height, index_in_block, &mut confirmed_tx,
8851+
funding, block_hash, height, index_in_block, &mut confirmed_tx, logger,
88418852
)? {
88428853
if funding_already_confirmed || confirmed_funding_index.is_some() {
88438854
let err_reason = "splice tx of another pending funding already confirmed";

0 commit comments

Comments
 (0)