|
@ -103,6 +103,11 @@ struct pay_command { |
|
|
/* Any remaining routehints to try. */ |
|
|
/* Any remaining routehints to try. */ |
|
|
struct route_info **routehints; |
|
|
struct route_info **routehints; |
|
|
|
|
|
|
|
|
|
|
|
#if DEVELOPER |
|
|
|
|
|
/* Disable the use of shadow route ? */ |
|
|
|
|
|
double use_shadow; |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
/* Current node during shadow route calculation. */ |
|
|
/* Current node during shadow route calculation. */ |
|
|
const char *shadow_dest; |
|
|
const char *shadow_dest; |
|
|
}; |
|
|
}; |
|
@ -873,6 +878,10 @@ static struct command_result *add_shadow_route(struct command *cmd, |
|
|
static struct command_result *shadow_route(struct command *cmd, |
|
|
static struct command_result *shadow_route(struct command *cmd, |
|
|
struct pay_command *pc) |
|
|
struct pay_command *pc) |
|
|
{ |
|
|
{ |
|
|
|
|
|
#if DEVELOPER |
|
|
|
|
|
if (!pc->use_shadow) |
|
|
|
|
|
return start_pay_attempt(cmd, pc, "Initial attempt"); |
|
|
|
|
|
#endif |
|
|
if (pseudorand(2) == 0) |
|
|
if (pseudorand(2) == 0) |
|
|
return start_pay_attempt(cmd, pc, "Initial attempt"); |
|
|
return start_pay_attempt(cmd, pc, "Initial attempt"); |
|
|
|
|
|
|
|
@ -1034,6 +1043,9 @@ static struct command_result *json_pay(struct command *cmd, |
|
|
double *maxfeepercent; |
|
|
double *maxfeepercent; |
|
|
unsigned int *maxdelay; |
|
|
unsigned int *maxdelay; |
|
|
struct amount_msat *exemptfee; |
|
|
struct amount_msat *exemptfee; |
|
|
|
|
|
#if DEVELOPER |
|
|
|
|
|
bool *use_shadow; |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
if (!param(cmd, buf, params, |
|
|
if (!param(cmd, buf, params, |
|
|
p_req("bolt11", param_string, &b11str), |
|
|
p_req("bolt11", param_string, &b11str), |
|
@ -1045,6 +1057,9 @@ static struct command_result *json_pay(struct command *cmd, |
|
|
p_opt_def("maxdelay", param_number, &maxdelay, |
|
|
p_opt_def("maxdelay", param_number, &maxdelay, |
|
|
maxdelay_default), |
|
|
maxdelay_default), |
|
|
p_opt_def("exemptfee", param_msat, &exemptfee, AMOUNT_MSAT(5000)), |
|
|
p_opt_def("exemptfee", param_msat, &exemptfee, AMOUNT_MSAT(5000)), |
|
|
|
|
|
#if DEVELOPER |
|
|
|
|
|
p_opt_def("use_shadow", param_bool, &use_shadow, true), |
|
|
|
|
|
#endif |
|
|
NULL)) |
|
|
NULL)) |
|
|
return command_param_failed(); |
|
|
return command_param_failed(); |
|
|
|
|
|
|
|
@ -1096,6 +1111,9 @@ static struct command_result *json_pay(struct command *cmd, |
|
|
pc->current_routehint = NULL; |
|
|
pc->current_routehint = NULL; |
|
|
pc->routehints = filter_routehints(pc, b11->routes); |
|
|
pc->routehints = filter_routehints(pc, b11->routes); |
|
|
pc->expensive_route = NULL; |
|
|
pc->expensive_route = NULL; |
|
|
|
|
|
#if DEVELOPER |
|
|
|
|
|
pc->use_shadow = *use_shadow; |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
/* Get capacities of local channels (no parameters) */ |
|
|
/* Get capacities of local channels (no parameters) */ |
|
|
return send_outreq(cmd, "listpeers", listpeers_done, forward_error, pc, |
|
|
return send_outreq(cmd, "listpeers", listpeers_done, forward_error, pc, |
|
|