1
0

start failing htlcs

This commit is contained in:
SomberNight
2018-10-18 22:56:40 +02:00
committed by ThomasV
parent ded11b4d9e
commit d511ecdc00
5 changed files with 96 additions and 29 deletions

View File

@@ -533,13 +533,17 @@ class Channel(PrintError):
self.log[LOCAL]['settles'].append(htlc_id)
# not saving preimage because it's already saved in LNWorker.invoices
def receive_htlc_settle(self, preimage, htlc_index):
def receive_htlc_settle(self, preimage, htlc_id):
self.print_error("receive_htlc_settle")
htlc = self.log[LOCAL]['adds'][htlc_index]
htlc = self.log[LOCAL]['adds'][htlc_id]
assert htlc.payment_hash == sha256(preimage)
self.log[REMOTE]['settles'].append(htlc_index)
self.log[REMOTE]['settles'].append(htlc_id)
# we don't save the preimage because we don't need to forward it anyway
def fail_htlc(self, htlc_id):
self.print_error("fail_htlc")
self.log[REMOTE]['adds'].pop(htlc_id)
def receive_fail_htlc(self, htlc_id):
self.print_error("receive_fail_htlc")
self.log[LOCAL]['adds'].pop(htlc_id)