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
This commit is contained in:
Vincent
2020-07-19 17:09:24 +02:00
committed by Rusty Russell
parent 9b4fd11e98
commit 54888d454b
2 changed files with 2 additions and 2 deletions

View File

@@ -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);

View File

@@ -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.