Skip to content

Commit 5f34c00

Browse files
committed
Log confirmation of channel funding transaction
1 parent e583ae8 commit 5f34c00

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
@@ -5526,10 +5526,13 @@ where
55265526
}
55275527

55285528
#[rustfmt::skip]
5529-
fn check_for_funding_tx_confirmed(
5529+
fn check_for_funding_tx_confirmed<L: Deref>(
55305530
&mut self, funding: &mut FundingScope, block_hash: &BlockHash, height: u32,
5531-
index_in_block: usize, tx: &mut ConfirmedTransaction,
5532-
) -> Result<bool, ClosureReason> {
5531+
index_in_block: usize, tx: &mut ConfirmedTransaction, logger: &L,
5532+
) -> Result<bool, ClosureReason>
5533+
where
5534+
L::Target: Logger,
5535+
{
55335536
let funding_txo = match funding.get_funding_txo() {
55345537
Some(funding_txo) => funding_txo,
55355538
None => {
@@ -5579,6 +5582,14 @@ where
55795582
Err(_) => panic!("Block was bogus - either height was > 16 million, had > 16 million transactions, or had > 65k outputs"),
55805583
};
55815584

5585+
log_info!(
5586+
logger,
5587+
"Funding txid {} for channel {} confirmed in block {}",
5588+
funding_txo.txid,
5589+
&self.channel_id(),
5590+
block_hash,
5591+
);
5592+
55825593
return Ok(true);
55835594
}
55845595
}
@@ -9130,7 +9141,7 @@ where
91309141
// and send it immediately instead of waiting for a best_block_updated call (which may have
91319142
// already happened for this block).
91329143
let is_funding_tx_confirmed = self.context.check_for_funding_tx_confirmed(
9133-
&mut self.funding, block_hash, height, index_in_block, &mut confirmed_tx,
9144+
&mut self.funding, block_hash, height, index_in_block, &mut confirmed_tx, logger,
91349145
)?;
91359146

91369147
if is_funding_tx_confirmed {
@@ -9162,7 +9173,7 @@ where
91629173
#[cfg(splicing)]
91639174
for (index, funding) in self.pending_funding.iter_mut().enumerate() {
91649175
if self.context.check_for_funding_tx_confirmed(
9165-
funding, block_hash, height, index_in_block, &mut confirmed_tx,
9176+
funding, block_hash, height, index_in_block, &mut confirmed_tx, logger,
91669177
)? {
91679178
if funding_already_confirmed || confirmed_funding_index.is_some() {
91689179
let err_reason = "splice tx of another pending funding already confirmed";

0 commit comments

Comments
 (0)