Browse Source

minor fix

regtest_lnd
ThomasV 6 years ago
committed by SomberNight
parent
commit
0242fdb6a3
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 6
      electrum/lnchan.py
  2. 2
      electrum/lnwatcher.py

6
electrum/lnchan.py

@ -343,7 +343,8 @@ class Channel(PrintError):
else: else:
their_cur_pcp = self.config[REMOTE].next_per_commitment_point their_cur_pcp = self.config[REMOTE].next_per_commitment_point
encumbered_sweeptx = maybe_create_sweeptx_for_their_ctx_to_remote(self, ctx, their_cur_pcp, self.sweep_address) encumbered_sweeptx = maybe_create_sweeptx_for_their_ctx_to_remote(self, ctx, their_cur_pcp, self.sweep_address)
self.lnwatcher.add_sweep_tx(outpoint, ctx.txid(), encumbered_sweeptx.to_json()) if encumbered_sweeptx:
self.lnwatcher.add_sweep_tx(outpoint, ctx.txid(), encumbered_sweeptx.to_json())
def process_new_revocation_secret(self, per_commitment_secret: bytes): def process_new_revocation_secret(self, per_commitment_secret: bytes):
if not self.lnwatcher: if not self.lnwatcher:
@ -351,7 +352,8 @@ class Channel(PrintError):
outpoint = self.funding_outpoint.to_str() outpoint = self.funding_outpoint.to_str()
ctx = self.remote_commitment_to_be_revoked ctx = self.remote_commitment_to_be_revoked
encumbered_sweeptx = maybe_create_sweeptx_for_their_ctx_to_local(self, ctx, per_commitment_secret, self.sweep_address) encumbered_sweeptx = maybe_create_sweeptx_for_their_ctx_to_local(self, ctx, per_commitment_secret, self.sweep_address)
self.lnwatcher.add_sweep_tx(outpoint, ctx.txid(), encumbered_sweeptx.to_json()) if encumbered_sweeptx:
self.lnwatcher.add_sweep_tx(outpoint, ctx.txid(), encumbered_sweeptx.to_json())
def receive_revocation(self, revocation): def receive_revocation(self, revocation):
""" """

2
electrum/lnwatcher.py

@ -185,8 +185,6 @@ class LNWatcher(PrintError):
@with_watchtower @with_watchtower
def add_sweep_tx(self, funding_outpoint: str, ctx_txid: str, sweeptx): def add_sweep_tx(self, funding_outpoint: str, ctx_txid: str, sweeptx):
encumbered_sweeptx = EncumberedTransaction.from_json(sweeptx) encumbered_sweeptx = EncumberedTransaction.from_json(sweeptx)
if encumbered_sweeptx is None:
return
with self.lock: with self.lock:
self.sweepstore[funding_outpoint][ctx_txid].add(encumbered_sweeptx) self.sweepstore[funding_outpoint][ctx_txid].add(encumbered_sweeptx)
self.write_to_disk() self.write_to_disk()

Loading…
Cancel
Save