Skip to content

Commit e482e61

Browse files
author
Antoine Riard
committed
Add log_trace on bump candidates tracking-buffer insertions
1 parent f39df44 commit e482e61

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ln/channelmonitor.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,6 +1348,7 @@ impl ChannelMonitor {
13481348
let (redeemscript, revocation_key) = sign_input!(sighash_parts, single_htlc_tx.input[0], Some(idx), htlc.amount_msat / 1000);
13491349
assert!(predicted_weight >= single_htlc_tx.get_weight());
13501350
assert_eq!(single_htlc_tx.input.len(), 1);
1351+
log_trace!(self, "Outpoint {}:{} is under claiming process, if it doesn't succeed, a bumped claiming txn is going to be broadcast at height {}", single_htlc_tx.input[0].previous_output.vout, single_htlc_tx.input[0].previous_output.txid, height + 3);
13511352
self.our_claim_txn_waiting_first_conf.insert(single_htlc_tx.input[0].previous_output.clone(), (height + 3, TxMaterial::Revoked { script: redeemscript, pubkey: Some(revocation_pubkey), key: revocation_key, is_htlc: true, amount: htlc.amount_msat / 1000 }, fee_estimator.get_est_sat_per_1000_weight(ConfirmationTarget::HighPriority)));
13521353
txn_to_broadcast.push(single_htlc_tx);
13531354
}
@@ -1423,6 +1424,7 @@ impl ChannelMonitor {
14231424

14241425
for (input, info) in spend_tx.input.iter_mut().zip(inputs_info.iter()) {
14251426
let (redeemscript, revocation_key) = sign_input!(sighash_parts, input, info.0, info.1);
1427+
log_trace!(self, "Outpoint {}:{} is under claiming process, if it doesn't succeed, a bumped claiming txn is going to be broadcast at height {}", input.previous_output.vout, input.previous_output.txid, height + 3);
14261428
self.our_claim_txn_waiting_first_conf.insert(input.previous_output.clone(), (height + 3, TxMaterial::Revoked { script: redeemscript, pubkey: if info.0.is_some() { Some(revocation_pubkey) } else { None }, key: revocation_key, is_htlc: if info.0.is_some() { true } else { false }, amount: info.1 }, fee_estimator.get_est_sat_per_1000_weight(ConfirmationTarget::HighPriority)));
14271429
}
14281430
assert!(predicted_weight >= spend_tx.get_weight());
@@ -1607,6 +1609,7 @@ impl ChannelMonitor {
16071609
outpoint: BitcoinOutPoint { txid: single_htlc_tx.txid(), vout: 0 },
16081610
output: single_htlc_tx.output[0].clone(),
16091611
});
1612+
log_trace!(self, "Outpoint {}:{} is under claiming process, if it doesn't succeed, a bumped claiming txn is going to be broadcast at height {}", single_htlc_tx.input[0].previous_output.vout, single_htlc_tx.input[0].previous_output.txid, height + 3);
16101613
self.our_claim_txn_waiting_first_conf.insert(single_htlc_tx.input[0].previous_output.clone(), (height + 3, TxMaterial::RemoteHTLC { script: redeemscript, key: htlc_key, preimage: Some(*payment_preimage), amount: htlc.amount_msat / 1000 }, fee_estimator.get_est_sat_per_1000_weight(ConfirmationTarget::HighPriority)));
16111614
txn_to_broadcast.push(single_htlc_tx);
16121615
}
@@ -1664,6 +1667,7 @@ impl ChannelMonitor {
16641667

16651668
for (input, info) in spend_tx.input.iter_mut().zip(inputs_info.iter()) {
16661669
let (redeemscript, htlc_key) = sign_input!(sighash_parts, input, info.1, (info.0).0.to_vec());
1670+
log_trace!(self, "Outpoint {}:{} is under claiming process, if it doesn't succeed, a bumped claiming txn is going to be broadcast at height {}", input.previous_output.vout, input.previous_output.txid, height + 3);
16671671
self.our_claim_txn_waiting_first_conf.insert(input.previous_output.clone(), (height + 3, TxMaterial::RemoteHTLC { script: redeemscript, key: htlc_key, preimage: Some(*(info.0)), amount: info.1}, fee_estimator.get_est_sat_per_1000_weight(ConfirmationTarget::HighPriority)));
16681672
}
16691673
assert!(predicted_weight >= spend_tx.get_weight());
@@ -1766,6 +1770,7 @@ impl ChannelMonitor {
17661770
assert!(predicted_weight >= spend_tx.get_weight());
17671771
let outpoint = BitcoinOutPoint { txid: spend_tx.txid(), vout: 0 };
17681772
let output = spend_tx.output[0].clone();
1773+
log_trace!(self, "Outpoint {}:{} is under claiming process, if it doesn't succeed, a bumped claiming txn is going to be broadcast at height {}", spend_tx.input[0].previous_output.vout, spend_tx.input[0].previous_output.txid, height + 3);
17691774
self.our_claim_txn_waiting_first_conf.insert(spend_tx.input[0].previous_output.clone(), (height + 3, TxMaterial::Revoked { script: redeemscript, pubkey: None, key: revocation_key, is_htlc: false, amount: tx.output[0].value }, fee_estimator.get_est_sat_per_1000_weight(ConfirmationTarget::HighPriority)));
17701775
(Some(spend_tx), Some(SpendableOutputDescriptor::StaticOutput { outpoint, output }))
17711776
} else { (None, None) }
@@ -1893,6 +1898,7 @@ impl ChannelMonitor {
18931898
spendable_outputs.append(&mut $updates.1);
18941899
watch_outputs.append(&mut $updates.2);
18951900
for claim in $updates.3 {
1901+
log_trace!(self, "Outpoint {}:{} is under claiming process, if it doesn't succeed, a bumped claiming txn is going to be broadcast at height {}", (claim.0).vout, (claim.0).txid, height + 3);
18961902
self.our_claim_txn_waiting_first_conf.insert(claim.0, claim.1);
18971903
}
18981904
}

0 commit comments

Comments
 (0)