1
0

ln: revoke before sending bare ctx in pay(), remove subtraction of trimmed amt from fee

This commit is contained in:
Janus
2018-07-06 22:54:26 +02:00
committed by ThomasV
parent 605d6ff5ca
commit 8573dd3b6a
3 changed files with 11 additions and 18 deletions

View File

@@ -228,7 +228,7 @@ def make_commitment(ctn, local_funding_pubkey, remote_funding_pubkey,
delayed_pubkey, to_self_delay, funding_txid,
funding_pos, funding_sat, local_amount, remote_amount,
dust_limit_sat, local_feerate, for_us, we_are_initiator,
htlcs, trimmed=0):
htlcs):
pubkeys = sorted([bh2u(local_funding_pubkey), bh2u(remote_funding_pubkey)])
payments = [payment_basepoint, remote_payment_basepoint]
@@ -256,7 +256,6 @@ def make_commitment(ctn, local_funding_pubkey, remote_funding_pubkey,
remote_address = bitcoin.pubkey_to_address('p2wpkh', bh2u(remote_payment_pubkey))
# TODO trim htlc outputs here while also considering 2nd stage htlc transactions
fee = local_feerate * overall_weight(len(htlcs))
fee -= trimmed * 1000
assert type(fee) is int
we_pay_fee = for_us == we_are_initiator
to_local_amt = local_amount - (fee if we_pay_fee else 0)