lnsweep: make maybe_create_sweeptx_for_their_ctx_to_local consistent

This commit is contained in:
Janus 2018-12-11 20:27:36 +01:00 committed by ThomasV
parent 3aa36c1502
commit 545182e0a5

View file

@ -36,7 +36,7 @@ def maybe_create_sweeptx_for_their_ctx_to_remote(ctx: Transaction, sweep_address
def maybe_create_sweeptx_for_their_ctx_to_local(ctx: Transaction, revocation_privkey: bytes,
to_self_delay: int, delayed_pubkey: bytes,
sweep_address: str) -> Optional[EncumberedTransaction]:
sweep_address: str) -> Optional[Transaction]:
revocation_pubkey = ecc.ECPrivkey(revocation_privkey).get_public_key_bytes(compressed=True)
witness_script = bh2u(make_commitment_output_to_local_witness_script(
revocation_pubkey, to_self_delay, delayed_pubkey))
@ -49,8 +49,7 @@ def maybe_create_sweeptx_for_their_ctx_to_local(ctx: Transaction, revocation_pri
witness_script=witness_script,
privkey=revocation_privkey,
is_revocation=True)
if sweep_tx is None: return None
return EncumberedTransaction('their_ctx_to_local', sweep_tx, csv_delay=0, cltv_expiry=0)
return sweep_tx
def create_sweeptxs_for_their_just_revoked_ctx(chan: 'Channel', ctx: Transaction, per_commitment_secret: bytes,