Skip to content

Commit

Permalink
offers: fix pay where we are using deprecated apis.
Browse files Browse the repository at this point in the history
In this case, "fee_base_msat" from `listincoming` has `msat` appended.

Fixes: ElementsProject#5850
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Feb 3, 2023
1 parent fc33150 commit b88fd04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions plugins/offers_invreq_hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ static struct command_result *listincoming_done(struct command *cmd,
const jsmntok_t *pftok;
u8 *features;
const char *err;
struct amount_msat feebase;

err = json_scan(tmpctx, buf, t,
"{id:%,"
Expand All @@ -295,7 +296,7 @@ static struct command_result *listincoming_done(struct command *cmd,
JSON_SCAN(json_to_msat, &ci.capacity),
JSON_SCAN(json_to_msat, &ci.htlc_min),
JSON_SCAN(json_to_msat, &ci.htlc_max),
JSON_SCAN(json_to_u32, &ci.feebase),
JSON_SCAN(json_to_msat, &feebase),
JSON_SCAN(json_to_u32, &ci.feeppm),
JSON_SCAN(json_to_u32, &ci.cltv),
JSON_SCAN(json_to_short_channel_id, &ci.scid),
Expand All @@ -306,7 +307,7 @@ static struct command_result *listincoming_done(struct command *cmd,
err);
continue;
}

ci.feebase = feebase.millisatoshis; /* Raw: feebase */
any_public |= ci.public;

/* Not presented if there's no channel_announcement for peer:
Expand Down
1 change: 0 additions & 1 deletion tests/test_pay.py
Original file line number Diff line number Diff line change
Expand Up @@ -4556,7 +4556,6 @@ def test_offer(node_factory, bitcoind):
assert 'recurrence: every 600 seconds paywindow -10 to +600 (pay proportional)\n' in output


@pytest.mark.xfail(strict=True)
def test_offer_deprecated_api(node_factory, bitcoind):
l1, l2 = node_factory.line_graph(2, opts={'experimental-offers': None,
'allow-deprecated-apis': True})
Expand Down

0 comments on commit b88fd04

Please sign in to comment.