1
0

tests: lnpeer.htlc_switch: don't fulfill htlc until add is irrevocable

This adds a failing test, where the HTLC switch fulfills an HTLC too soon,
before the corresponding 'update_add_htlc' is irrevocably committed.
This commit is contained in:
SomberNight
2021-01-28 20:00:48 +01:00
parent 521376f87f
commit e8a2fa5596
5 changed files with 110 additions and 0 deletions

View File

@@ -1299,6 +1299,7 @@ class LNWallet(LNWorker):
self.set_payment_status(bfh(key), status)
async def await_payment(self, payment_hash: bytes) -> BarePaymentAttemptLog:
# note side-effect: Future is created and added here (defaultdict):
payment_attempt = await self.pending_payments[payment_hash]
self.pending_payments.pop(payment_hash)
return payment_attempt