Skip to content

Commit eb2c8f7

Browse files
author
Antoine Riard
committed
Fix: use our_to_self_delay in check_spend_remote_htlc
We were previously using their_to_self_delay to regenerate scripts for spending remote revoked htlc transactions, and that's a bug. Their_to_self_delay is delay enforced by peer upon outputs returning funds back to us. Our_to_self_delay is delay enforced by us upon outputs returning funds back to peer.
1 parent 100197c commit eb2c8f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ln/channelmonitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,7 @@ impl ChannelMonitor {
15671567
None => return (None, None),
15681568
Some(their_delayed_payment_base_key) => ignore_error!(chan_utils::derive_public_key(&self.secp_ctx, &per_commitment_point, &their_delayed_payment_base_key)),
15691569
};
1570-
let redeemscript = chan_utils::get_revokeable_redeemscript(&revocation_pubkey, self.their_to_self_delay.unwrap(), &delayed_key);
1570+
let redeemscript = chan_utils::get_revokeable_redeemscript(&revocation_pubkey, self.our_to_self_delay, &delayed_key);
15711571
let revokeable_p2wsh = redeemscript.to_v0_p2wsh();
15721572
let htlc_txid = tx.txid(); //TODO: This is gonna be a performance bottleneck for watchtowers!
15731573

0 commit comments

Comments
 (0)