Browse Source

Fixed assertion in pay plugin

This PR includes the fix discussed on PR #3855. This fix was tested with the use case described inside the issue and worked.

Fixes: #3855

Changelog-None
route-mem-overrun
Vincent 4 years ago
committed by Rusty Russell
parent
commit
54888d454b
  1. 3
      plugins/libplugin-pay.c
  2. 1
      tests/test_pay.py

3
plugins/libplugin-pay.c

@ -1622,7 +1622,8 @@ local_channel_hints_listpeers(struct command *cmd, const char *buffer,
spendsats = json_get_member(buffer, channel, "spendable_msat");
scid = json_get_member(buffer, channel, "short_channel_id");
dir = json_get_member(buffer, channel, "direction");
assert(spendsats != NULL && scid != NULL && dir != NULL);
if(spendsats == NULL || scid == NULL || dir == NULL)
continue;
json_to_bool(buffer, connected, &h.enabled);
json_to_short_channel_id(buffer, scid, &h.scid.scid);

1
tests/test_pay.py

@ -3157,7 +3157,6 @@ def test_mpp_adaptive(node_factory, bitcoind):
pprint(l1.rpc.paystatus(inv))
@pytest.mark.xfail(strict=True)
def test_pay_fail_unconfirmed_channel(node_factory, bitcoind):
'''
Replicate #3855.

Loading…
Cancel
Save