Browse Source

lnhtlc: use current_per_commitment_point, current_commitment_signature

regtest_lnd
Janus 7 years ago
committed by SomberNight
parent
commit
7ac7b8d631
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 2
      lib/lnhtlc.py
  2. 5
      lib/tests/test_lnhtlc.py

2
lib/lnhtlc.py

@ -274,7 +274,7 @@ class HTLCStateMachine(PrintError):
self.state = self.state._replace( self.state = self.state._replace(
remote_state=self.state.remote_state._replace( remote_state=self.state.remote_state._replace(
ctn=self.state.remote_state.ctn + 1, ctn=self.state.remote_state.ctn + 1,
last_per_commitment_point=next_point, current_per_commitment_point=next_point,
next_per_commitment_point=revocation.next_per_commitment_point, next_per_commitment_point=revocation.next_per_commitment_point,
amount_msat=self.state.remote_state.amount_msat + (sent_this_batch - received_this_batch) amount_msat=self.state.remote_state.amount_msat + (sent_this_batch - received_this_batch)
), ),

5
lib/tests/test_lnhtlc.py

@ -45,7 +45,7 @@ def create_channel_state(funding_txid, funding_index, funding_sat, local_feerate
remote_state=lnbase.RemoteState( remote_state=lnbase.RemoteState(
ctn = 0, ctn = 0,
next_per_commitment_point=nex, next_per_commitment_point=nex,
last_per_commitment_point=cur, current_per_commitment_point=cur,
amount_msat=remote_amount, amount_msat=remote_amount,
revocation_store=their_revocation_store, revocation_store=their_revocation_store,
next_htlc_id = 0 next_htlc_id = 0
@ -56,7 +56,8 @@ def create_channel_state(funding_txid, funding_index, funding_sat, local_feerate
amount_msat=local_amount, amount_msat=local_amount,
next_htlc_id = 0, next_htlc_id = 0,
funding_locked_received=True, funding_locked_received=True,
was_announced=False was_announced=False,
current_commitment_signature=None
), ),
constraints=lnbase.ChannelConstraints(capacity=funding_sat, feerate=local_feerate, is_initiator=is_initiator, funding_txn_minimum_depth=3), constraints=lnbase.ChannelConstraints(capacity=funding_sat, feerate=local_feerate, is_initiator=is_initiator, funding_txn_minimum_depth=3),
node_id=other_node_id node_id=other_node_id

Loading…
Cancel
Save