Skip to content

Commit fbd267b

Browse files
committed
f tweak variable name and add comment describing behavior
1 parent 4d11f31 commit fbd267b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lightning/src/ln/channel.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3682,9 +3682,11 @@ impl<Signer: Sign> Channel<Signer> {
36823682
/// force-close the channel, but may also indicate a harmless reorganization of a block or two.
36833683
pub fn funding_transaction_unconfirmed(&mut self) -> Result<(), msgs::ErrorMessage> {
36843684
if self.funding_tx_confirmation_height != 0 {
3685-
let effective_new_height = self.funding_tx_confirmation_height - 1;
3685+
// We handle the funding disconnection by calling update_best_block with a height one
3686+
// below where our funding was connected, implying a reorg back to conf_height - 1.
3687+
let reorg_height = self.funding_tx_confirmation_height - 1;
36863688
let best_time = self.update_time_counter;
3687-
match self.update_best_block(effective_new_height, best_time) {
3689+
match self.update_best_block(reorg_height, best_time) {
36883690
Ok((funding_locked, timed_out_htlcs)) => {
36893691
assert!(funding_locked.is_none(), "We can't generate a funding with 0 confirmations?");
36903692
assert!(timed_out_htlcs.is_empty(), "We can't have accepted HTLCs with a timeout before our funding confirmation?");

0 commit comments

Comments
 (0)