mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
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:
parent
f9021b6ca6
commit
847208f5d8
2 changed files with 8 additions and 3 deletions
|
@ -1102,7 +1102,8 @@ htlc_accepted_hook_final(struct htlc_accepted_hook_payload *request STEALS)
|
||||||
/* *Now* we barf if it failed to decode */
|
/* *Now* we barf if it failed to decode */
|
||||||
if (!request->payload) {
|
if (!request->payload) {
|
||||||
log_debug(channel->log,
|
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,
|
local_fail_in_htlc(hin,
|
||||||
take(towire_invalid_onion_payload(
|
take(towire_invalid_onion_payload(
|
||||||
NULL, request->failtlvtype,
|
NULL, request->failtlvtype,
|
||||||
|
|
|
@ -1227,8 +1227,12 @@ static const char *init(struct plugin *p,
|
||||||
{
|
{
|
||||||
rpc_scan(p, "getinfo",
|
rpc_scan(p, "getinfo",
|
||||||
take(json_out_obj(NULL, NULL, NULL)),
|
take(json_out_obj(NULL, NULL, NULL)),
|
||||||
"{id:%}", JSON_SCAN(json_to_pubkey, &id),
|
"{id:%}", JSON_SCAN(json_to_pubkey, &id));
|
||||||
"{blockheight:%}", JSON_SCAN(json_to_u32, &blockheight));
|
|
||||||
|
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",
|
rpc_scan(p, "listconfigs",
|
||||||
take(json_out_obj(NULL, NULL, NULL)),
|
take(json_out_obj(NULL, NULL, NULL)),
|
||||||
|
|
Loading…
Add table
Reference in a new issue