Skip to content

Commit d221079

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

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
@@ -25,6 +25,8 @@
2525
#include <plugins/libplugin.h>
2626
#include <stdarg.h>
2727

28+
#define XPAY_GLOBAL_LAYER "xpay"
29+
2830
/* For the whole plugin */
2931
struct xpay {
3032
struct pubkey local_id;
@@ -486,7 +488,7 @@ static const char *layer_of(const struct payment *payment,
486488
struct gossmap *gossmap = get_gossmap(xpay_of(payment->plugin));
487489

488490
if (gossmap_find_chan(gossmap, &scidd->scid))
489-
return "xpay";
491+
return XPAY_GLOBAL_LAYER;
490492
return payment->private_layer;
491493
}
492494

@@ -1372,7 +1374,7 @@ static struct command_result *getroutes_for(struct command *aux_cmd,
13721374
/* We don't pay fees for ourselves */
13731375
json_add_string(req->js, NULL, "auto.sourcefree");
13741376
/* Add xpay global channel */
1375-
json_add_string(req->js, NULL, "xpay");
1377+
json_add_string(req->js, NULL, XPAY_GLOBAL_LAYER);
13761378
/* Add private layer */
13771379
json_add_string(req->js, NULL, payment->private_layer);
13781380
/* Add user-specified layers */
@@ -2095,7 +2097,7 @@ static struct command_result *age_layer(struct command *timer_cmd, void *unused)
20952097
age_done,
20962098
plugin_broken_cb,
20972099
NULL);
2098-
json_add_string(req->js, "layer", "xpay");
2100+
json_add_string(req->js, "layer", XPAY_GLOBAL_LAYER);
20992101
json_add_u64(req->js, "cutoff", time_now().ts.tv_sec - 3600);
21002102
return send_outreq(req);
21012103
}
@@ -2155,7 +2157,7 @@ static const char *init(struct command *init_cmd,
21552157
xpay_layer_created,
21562158
plugin_broken_cb,
21572159
"askrene-create-layer");
2158-
json_add_string(req->js, "layer", "xpay");
2160+
json_add_string(req->js, "layer", XPAY_GLOBAL_LAYER);
21592161
json_add_bool(req->js, "persistent", true);
21602162
send_outreq(req);
21612163

0 commit comments

Comments
 (0)