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