Skip to content

Commit 2129d53

Browse files
committed
Log confirmation of channel funding transaction
1 parent 3cd2f42 commit 2129d53

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
@@ -5058,10 +5058,13 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
50585058
self.get_initial_counterparty_commitment_signature(funding, logger)
50595059
}
50605060

5061-
fn check_for_funding_tx_confirmed(
5061+
fn check_for_funding_tx_confirmed<L: Deref>(
50625062
&mut self, funding: &mut FundingScope, block_hash: &BlockHash, height: u32,
5063-
index_in_block: usize, tx: &mut ConfirmedTransaction,
5064-
) -> Result<bool, ClosureReason> {
5063+
index_in_block: usize, tx: &mut ConfirmedTransaction, logger: &L,
5064+
) -> Result<bool, ClosureReason>
5065+
where
5066+
L::Target: Logger,
5067+
{
50655068
let funding_txo = match funding.get_funding_txo() {
50665069
Some(funding_txo) => funding_txo,
50675070
None => {
@@ -5118,6 +5121,14 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
51185121
Err(_) => panic!("Block was bogus - either height was > 16 million, had > 16 million transactions, or had > 65k outputs"),
51195122
};
51205123

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

86898700
if is_funding_tx_confirmed {
@@ -8713,7 +8724,7 @@ impl<SP: Deref> FundedChannel<SP> where
87138724
#[cfg(splicing)]
87148725
for (index, funding) in self.pending_funding.iter_mut().enumerate() {
87158726
if self.context.check_for_funding_tx_confirmed(
8716-
funding, block_hash, height, index_in_block, &mut confirmed_tx,
8727+
funding, block_hash, height, index_in_block, &mut confirmed_tx, logger,
87178728
)? {
87188729
if confirmed_funding_index.is_some() {
87198730
let err_reason = "splice tx of another pending funding already confirmed";

0 commit comments

Comments
 (0)