offers: fix pay where we are using deprecated apis.

In this case, "fee_base_msat" from `listincoming` has `msat` appended.

Fixes: #5850
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-01-31 10:52:51 +10:30
committed by Vincenzo Palazzo
parent e8f9366a29
commit 35acdc112f
2 changed files with 3 additions and 3 deletions

View File

@@ -280,6 +280,7 @@ static struct command_result *listincoming_done(struct command *cmd,
const jsmntok_t *pftok; const jsmntok_t *pftok;
u8 *features; u8 *features;
const char *err; const char *err;
struct amount_msat feebase;
err = json_scan(tmpctx, buf, t, err = json_scan(tmpctx, buf, t,
"{id:%," "{id:%,"
@@ -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.capacity),
JSON_SCAN(json_to_msat, &ci.htlc_min), JSON_SCAN(json_to_msat, &ci.htlc_min),
JSON_SCAN(json_to_msat, &ci.htlc_max), 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.feeppm),
JSON_SCAN(json_to_u32, &ci.cltv), JSON_SCAN(json_to_u32, &ci.cltv),
JSON_SCAN(json_to_short_channel_id, &ci.scid), JSON_SCAN(json_to_short_channel_id, &ci.scid),
@@ -306,7 +307,7 @@ static struct command_result *listincoming_done(struct command *cmd,
err); err);
continue; continue;
} }
ci.feebase = feebase.millisatoshis; /* Raw: feebase */
any_public |= ci.public; any_public |= ci.public;
/* Not presented if there's no channel_announcement for peer: /* Not presented if there's no channel_announcement for peer:

View File

@@ -4556,7 +4556,6 @@ def test_offer(node_factory, bitcoind):
assert 'recurrence: every 600 seconds paywindow -10 to +600 (pay proportional)\n' in output 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): def test_offer_deprecated_api(node_factory, bitcoind):
l1, l2 = node_factory.line_graph(2, opts={'experimental-offers': None, l1, l2 = node_factory.line_graph(2, opts={'experimental-offers': None,
'allow-deprecated-apis': True}) 'allow-deprecated-apis': True})