1
0

lnworker: fix type error re pending_payments, and impl malformed htlcs

In old code, in lnpeer.htlc_switch(), "error" in lnworker.pending_payments
had incorrect type.

TODO: we need tests for payment failures...
This commit is contained in:
SomberNight
2020-03-17 19:23:04 +01:00
parent 9a70b79eea
commit 2cc76fbbbd
5 changed files with 92 additions and 60 deletions

View File

@@ -619,7 +619,7 @@ class TestAvailableToSpend(ElectrumTestCase):
bob_idx = bob_channel.receive_htlc(htlc_dict).htlc_id
force_state_transition(alice_channel, bob_channel)
bob_channel.fail_htlc(bob_idx)
alice_channel.receive_fail_htlc(alice_idx, None)
alice_channel.receive_fail_htlc(alice_idx, error_bytes=None)
# Alice now has gotten all her original balance (5 BTC) back, however,
# adding a new HTLC at this point SHOULD fail, since if she adds the
# HTLC and signs the next state, Bob cannot assume she received the