Skip to content

Commit 1380d36

Browse files
committed
xpay: don't try to timeout things until after we have created xpay layer.
``` lightningd-1 2024-11-19T05:21:16.313Z DEBUG lightningd: Looking for [askrene,layers] lightningd-1 2024-11-19T05:21:16.314Z DEBUG lightningd: Got [askrene,layers,xpay] lightningd-1 2024-11-19T05:21:16.314Z DEBUG lightningd: Printing lightningd-1 2024-11-19T05:21:16.315Z **BROKEN** plugin-cln-xpay: askrene-age failed with {\"code\":-32602,\"message\":\"layer: Unknown layer: invalid token '\\\"xpay\\\"'\"} lightningd-1 2024-11-19T05:21:16.318Z DEBUG plugin-cln-askrene: datastore = {\"datastore\":[{\"key\":[\"askrene\",\"layers\",\"xpay\"],\"generation\":13,\"hex\":\"000300001000003f47af0100000000673c1fea010000000000d1b0d4000003000000000ce5066e0000000000673c1fea010000000000d1b0d400000300001000001a47050000000000673c1fea010000000000d1b0d400000300003f00005a72b40100000000673c1fea010000000000d1b0d400000300000000005a07e80100000000673c1fea010000000000d1b0d400000300001a0000e3564c0100000000673c1fea010000000000d1b0d40000030000e3000db69cf50000000000673c1fea0001000000000100637e\"}]} lightningd-1 2024-11-19T05:21:16.318Z DEBUG plugin-cln-askrene: Loaded level xpay (203 bytes) lightningd-1 2024-11-19T05:21:16.391Z INFO plugin-cln-xpay: Killing plugin: exited during normal operation ``` Signed-off-by: Rusty Russell <[email protected]>
1 parent 6c347a4 commit 1380d36

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

plugins/xpay/xpay.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,6 +1617,16 @@ static void start_aging_timer(struct plugin *plugin)
16171617
notleak(global_timer(plugin, time_from_sec(60), age_layer, NULL));
16181618
}
16191619

1620+
static struct command_result *xpay_layer_created(struct command *aux_cmd,
1621+
const char *method,
1622+
const char *buf,
1623+
const jsmntok_t *result,
1624+
void *unused)
1625+
{
1626+
start_aging_timer(aux_cmd->plugin);
1627+
return aux_command_done(aux_cmd);
1628+
}
1629+
16201630
static const char *init(struct command *init_cmd,
16211631
const char *buf UNUSED, const jsmntok_t *config UNUSED)
16221632
{
@@ -1656,14 +1666,13 @@ static const char *init(struct command *init_cmd,
16561666
send_outreq(req);
16571667

16581668
req = jsonrpc_request_start(aux_command(init_cmd), "askrene-create-layer",
1659-
ignore_and_complete,
1669+
xpay_layer_created,
16601670
plugin_broken_cb,
16611671
"askrene-create-layer");
16621672
json_add_string(req->js, "layer", "xpay");
16631673
json_add_bool(req->js, "persistent", true);
16641674
send_outreq(req);
16651675

1666-
start_aging_timer(plugin);
16671676
return NULL;
16681677
}
16691678

0 commit comments

Comments
 (0)