1
0

special case receiving payment after fee update, fee update injector

This commit is contained in:
Janus
2018-07-23 20:16:03 +02:00
committed by ThomasV
parent a5b44d25b0
commit 7f0568d83a
3 changed files with 45 additions and 11 deletions

View File

@@ -287,17 +287,15 @@ class HTLCStateMachine(PrintError):
last_secret, this_point, next_point = self.points
new_local_feerate = self.local_state.feerate
new_remote_feerate = self.remote_state.feerate
if self.pending_fee is not None:
if not self.constraints.is_initiator and (self.pending_fee.progress & FUNDEE_SIGNED):
new_local_feerate = self.pending_fee.rate
self.remote_state=self.remote_state._replace(
feerate=self.pending_fee.rate
)
new_local_feerate = new_remote_feerate = self.pending_fee.rate
self.pending_fee = None
print("FEERATE CHANGE COMPLETE (non-initiator)")
if self.constraints.is_initiator and (self.pending_fee.progress & FUNDER_SIGNED):
new_local_feerate = self.pending_fee.rate
new_local_feerate = new_remote_feerate = self.pending_fee.rate
self.pending_fee = None
print("FEERATE CHANGE COMPLETE (initiator)")
@@ -305,6 +303,9 @@ class HTLCStateMachine(PrintError):
ctn=self.local_state.ctn + 1,
feerate=new_local_feerate
)
self.remote_state=self.remote_state._replace(
feerate=new_remote_feerate
)
self.local_commitment = self.pending_local_commitment