offers: put correct CLTV limit inside blinded paths.

At plugin startup, we don't have an accurate blockheight and can get 0!

Fixes: https://github.com/ElementsProject/lightning/issues/7161
Reported-by: @carlaKC
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2024-05-14 21:11:10 +09:30 committed by Alex Myers
parent f9021b6ca6
commit 847208f5d8
2 changed files with 8 additions and 3 deletions

View file

@ -1102,7 +1102,8 @@ htlc_accepted_hook_final(struct htlc_accepted_hook_payload *request STEALS)
/* *Now* we barf if it failed to decode */
if (!request->payload) {
log_debug(channel->log,
"Failing HTLC because of an invalid payload");
"Failing HTLC because of an invalid payload (TLV %"PRIu64" pos %zu)",
request->failtlvtype, request->failtlvpos);
local_fail_in_htlc(hin,
take(towire_invalid_onion_payload(
NULL, request->failtlvtype,

View file

@ -1227,8 +1227,12 @@ static const char *init(struct plugin *p,
{
rpc_scan(p, "getinfo",
take(json_out_obj(NULL, NULL, NULL)),
"{id:%}", JSON_SCAN(json_to_pubkey, &id),
"{blockheight:%}", JSON_SCAN(json_to_u32, &blockheight));
"{id:%}", JSON_SCAN(json_to_pubkey, &id));
rpc_scan(p, "getchaininfo",
take(json_out_obj(NULL, "last_height", "0")),
"{headercount:%}", JSON_SCAN(json_to_u32, &blockheight));
assert(blockheight);
rpc_scan(p, "listconfigs",
take(json_out_obj(NULL, NULL, NULL)),