Skip to content

Commit 417698f

Browse files
committed
Log confirmation of channel funding transaction
1 parent 1704b53 commit 417698f

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
@@ -5514,10 +5514,13 @@ where
55145514
}
55155515

55165516
#[rustfmt::skip]
5517-
fn check_for_funding_tx_confirmed(
5517+
fn check_for_funding_tx_confirmed<L: Deref>(
55185518
&mut self, funding: &mut FundingScope, block_hash: &BlockHash, height: u32,
5519-
index_in_block: usize, tx: &mut ConfirmedTransaction,
5520-
) -> Result<bool, ClosureReason> {
5519+
index_in_block: usize, tx: &mut ConfirmedTransaction, logger: &L,
5520+
) -> Result<bool, ClosureReason>
5521+
where
5522+
L::Target: Logger,
5523+
{
55215524
let funding_txo = match funding.get_funding_txo() {
55225525
Some(funding_txo) => funding_txo,
55235526
None => {
@@ -5567,6 +5570,14 @@ where
55675570
Err(_) => panic!("Block was bogus - either height was > 16 million, had > 16 million transactions, or had > 65k outputs"),
55685571
};
55695572

5573+
log_info!(
5574+
logger,
5575+
"Funding txid {} for channel {} confirmed in block {}",
5576+
funding_txo.txid,
5577+
&self.channel_id(),
5578+
block_hash,
5579+
);
5580+
55705581
return Ok(true);
55715582
}
55725583
}
@@ -9086,7 +9097,7 @@ where
90869097
// and send it immediately instead of waiting for a best_block_updated call (which may have
90879098
// already happened for this block).
90889099
let is_funding_tx_confirmed = self.context.check_for_funding_tx_confirmed(
9089-
&mut self.funding, block_hash, height, index_in_block, &mut confirmed_tx,
9100+
&mut self.funding, block_hash, height, index_in_block, &mut confirmed_tx, logger,
90909101
)?;
90919102

90929103
if is_funding_tx_confirmed {
@@ -9118,7 +9129,7 @@ where
91189129
#[cfg(splicing)]
91199130
for (index, funding) in self.pending_funding.iter_mut().enumerate() {
91209131
if self.context.check_for_funding_tx_confirmed(
9121-
funding, block_hash, height, index_in_block, &mut confirmed_tx,
9132+
funding, block_hash, height, index_in_block, &mut confirmed_tx, logger,
91229133
)? {
91239134
if funding_already_confirmed || confirmed_funding_index.is_some() {
91249135
let err_reason = "splice tx of another pending funding already confirmed";

0 commit comments

Comments
 (0)