Skip to content

Commit 6c36b80

Browse files
committed
xpay: identify global layer with a name
Changelog-None Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
1 parent b44eca5 commit 6c36b80

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

plugins/xpay/xpay.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include <plugins/libplugin.h>
2424
#include <stdarg.h>
2525

26+
#define XPAY_GLOBAL_LAYER "xpay"
27+
2628
/* For the whole plugin */
2729
struct xpay {
2830
struct pubkey local_id;
@@ -484,7 +486,7 @@ static const char *layer_of(const struct payment *payment,
484486
struct gossmap *gossmap = get_gossmap(xpay_of(payment->plugin));
485487

486488
if (gossmap_find_chan(gossmap, &scidd->scid))
487-
return "xpay";
489+
return XPAY_GLOBAL_LAYER;
488490
return payment->private_layer;
489491
}
490492

@@ -1370,7 +1372,7 @@ static struct command_result *getroutes_for(struct command *aux_cmd,
13701372
/* We don't pay fees for ourselves */
13711373
json_add_string(req->js, NULL, "auto.sourcefree");
13721374
/* Add xpay global channel */
1373-
json_add_string(req->js, NULL, "xpay");
1375+
json_add_string(req->js, NULL, XPAY_GLOBAL_LAYER);
13741376
/* Add private layer */
13751377
json_add_string(req->js, NULL, payment->private_layer);
13761378
/* Add user-specified layers */
@@ -2093,7 +2095,7 @@ static struct command_result *age_layer(struct command *timer_cmd, void *unused)
20932095
age_done,
20942096
plugin_broken_cb,
20952097
NULL);
2096-
json_add_string(req->js, "layer", "xpay");
2098+
json_add_string(req->js, "layer", XPAY_GLOBAL_LAYER);
20972099
json_add_u64(req->js, "cutoff", time_now().ts.tv_sec - 3600);
20982100
return send_outreq(req);
20992101
}
@@ -2153,7 +2155,7 @@ static const char *init(struct command *init_cmd,
21532155
xpay_layer_created,
21542156
plugin_broken_cb,
21552157
"askrene-create-layer");
2156-
json_add_string(req->js, "layer", "xpay");
2158+
json_add_string(req->js, "layer", XPAY_GLOBAL_LAYER);
21572159
json_add_bool(req->js, "persistent", true);
21582160
send_outreq(req);
21592161

0 commit comments

Comments
 (0)