|
23 | 23 | #include <plugins/libplugin.h> |
24 | 24 | #include <stdarg.h> |
25 | 25 |
|
| 26 | +#define XPAY_GLOBAL_LAYER "xpay" |
| 27 | + |
26 | 28 | /* For the whole plugin */ |
27 | 29 | struct xpay { |
28 | 30 | struct pubkey local_id; |
@@ -484,7 +486,7 @@ static const char *layer_of(const struct payment *payment, |
484 | 486 | struct gossmap *gossmap = get_gossmap(xpay_of(payment->plugin)); |
485 | 487 |
|
486 | 488 | if (gossmap_find_chan(gossmap, &scidd->scid)) |
487 | | - return "xpay"; |
| 489 | + return XPAY_GLOBAL_LAYER; |
488 | 490 | return payment->private_layer; |
489 | 491 | } |
490 | 492 |
|
@@ -1370,7 +1372,7 @@ static struct command_result *getroutes_for(struct command *aux_cmd, |
1370 | 1372 | /* We don't pay fees for ourselves */ |
1371 | 1373 | json_add_string(req->js, NULL, "auto.sourcefree"); |
1372 | 1374 | /* Add xpay global channel */ |
1373 | | - json_add_string(req->js, NULL, "xpay"); |
| 1375 | + json_add_string(req->js, NULL, XPAY_GLOBAL_LAYER); |
1374 | 1376 | /* Add private layer */ |
1375 | 1377 | json_add_string(req->js, NULL, payment->private_layer); |
1376 | 1378 | /* Add user-specified layers */ |
@@ -2093,7 +2095,7 @@ static struct command_result *age_layer(struct command *timer_cmd, void *unused) |
2093 | 2095 | age_done, |
2094 | 2096 | plugin_broken_cb, |
2095 | 2097 | NULL); |
2096 | | - json_add_string(req->js, "layer", "xpay"); |
| 2098 | + json_add_string(req->js, "layer", XPAY_GLOBAL_LAYER); |
2097 | 2099 | json_add_u64(req->js, "cutoff", time_now().ts.tv_sec - 3600); |
2098 | 2100 | return send_outreq(req); |
2099 | 2101 | } |
@@ -2153,7 +2155,7 @@ static const char *init(struct command *init_cmd, |
2153 | 2155 | xpay_layer_created, |
2154 | 2156 | plugin_broken_cb, |
2155 | 2157 | "askrene-create-layer"); |
2156 | | - json_add_string(req->js, "layer", "xpay"); |
| 2158 | + json_add_string(req->js, "layer", XPAY_GLOBAL_LAYER); |
2157 | 2159 | json_add_bool(req->js, "persistent", true); |
2158 | 2160 | send_outreq(req); |
2159 | 2161 |
|
|
0 commit comments