From 4d26fb552bf769192e9fc896dcb005408661b58f Mon Sep 17 00:00:00 2001 From: ThomasV Date: Wed, 20 Nov 2024 15:02:05 +0100 Subject: [PATCH] fixes after rebase --- electrum/lnchannel.py | 4 ++-- electrum/lnsweep.py | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/electrum/lnchannel.py b/electrum/lnchannel.py index 19395ab61..d04c85f79 100644 --- a/electrum/lnchannel.py +++ b/electrum/lnchannel.py @@ -665,7 +665,7 @@ class ChannelBackup(AbstractChannel): # we might calculate a different address here, which might not be wallet.is_mine, # but that should be harmless) our_payment_pubkey = self.config[LOCAL].payment_basepoint.pubkey - to_remote_address = make_commitment_output_to_remote_address(our_payment_pubkey) + to_remote_address = make_commitment_output_to_remote_address(our_payment_pubkey, has_anchors=self.has_anchors()) return [to_remote_address] else: # on-chain backup return [] @@ -1235,7 +1235,7 @@ class Channel(AbstractChannel): htlc_sigs = list(chunks(data, 64)) htlc_sig = htlc_sigs[htlc_relative_idx] remote_sighash = Sighash.ALL if not self.has_anchors() else Sighash.ANYONECANPAY | Sighash.SINGLE - remote_htlc_sig = ecc.ecdsa_der_sig_from_ecdsa_sig64(htlc_sig) + remote_sighash.to_sigbytes(1, 'big') + remote_htlc_sig = ecc.ecdsa_der_sig_from_ecdsa_sig64(htlc_sig) + Sighash.to_sigbytes(remote_sighash) return remote_htlc_sig def revoke_current_commitment(self): diff --git a/electrum/lnsweep.py b/electrum/lnsweep.py index 86d227da9..42de48cd5 100644 --- a/electrum/lnsweep.py +++ b/electrum/lnsweep.py @@ -214,7 +214,7 @@ def create_sweeptxs_for_our_ctx( if not chan.is_backup(): assert chan.is_static_remotekey_enabled() their_payment_pubkey = their_conf.payment_basepoint.pubkey - to_remote_address = make_commitment_output_to_remote_address(their_payment_pubkey) + to_remote_address = make_commitment_output_to_remote_address(their_payment_pubkey, has_anchors=chan.has_anchors()) found_to_remote = bool(ctx.get_output_idxs_from_address(to_remote_address)) else: found_to_remote = False @@ -370,7 +370,7 @@ def create_sweeptxs_for_their_ctx( if not chan.is_backup(): assert chan.is_static_remotekey_enabled() our_payment_pubkey = our_conf.payment_basepoint.pubkey - to_remote_address = make_commitment_output_to_remote_address(our_payment_pubkey) + to_remote_address = make_commitment_output_to_remote_address(our_payment_pubkey, has_anchors=chan.has_anchors()) found_to_remote = bool(ctx.get_output_idxs_from_address(to_remote_address)) else: found_to_remote = False @@ -404,7 +404,8 @@ def create_sweeptxs_for_their_ctx( remote_htlc_pubkey=our_htlc_privkey.get_public_key_bytes(compressed=True), local_htlc_pubkey=their_htlc_pubkey, payment_hash=htlc.payment_hash, - cltv_abs=htlc.cltv_abs) + cltv_abs=htlc.cltv_abs, + has_anchors=chan.has_anchors()) cltv_abs = htlc.cltv_abs if is_received_htlc and not is_revocation else 0 prevout = ctx.txid() + ':%d'%ctx_output_idx