|
|
@ -276,7 +276,7 @@ static void json_getroute(struct command *cmd, const char *buffer, const jsmntok |
|
|
|
struct pubkey source; |
|
|
|
const jsmntok_t *seedtok; |
|
|
|
u64 msatoshi; |
|
|
|
unsigned cltv; |
|
|
|
unsigned *cltv; |
|
|
|
double riskfactor; |
|
|
|
/* Higher fuzz means that some high-fee paths can be discounted
|
|
|
|
* for an even larger value, increasing the scope for route |
|
|
@ -290,7 +290,7 @@ static void json_getroute(struct command *cmd, const char *buffer, const jsmntok |
|
|
|
p_req("id", json_tok_pubkey, &destination), |
|
|
|
p_req("msatoshi", json_tok_u64, &msatoshi), |
|
|
|
p_req("riskfactor", json_tok_double, &riskfactor), |
|
|
|
p_opt_def("cltv", json_tok_number, &cltv, 9), |
|
|
|
p_opt_def_tal("cltv", json_tok_number, &cltv, 9), |
|
|
|
p_opt_def("fromid", json_tok_pubkey, &source, ld->id), |
|
|
|
p_opt_def("fuzzpercent", json_tok_double, &fuzz, 75.0), |
|
|
|
p_opt_tal("seed", json_tok_tok, &seedtok), |
|
|
@ -317,7 +317,7 @@ static void json_getroute(struct command *cmd, const char *buffer, const jsmntok |
|
|
|
} else |
|
|
|
randombytes_buf(&seed, sizeof(seed)); |
|
|
|
|
|
|
|
u8 *req = towire_gossip_getroute_request(cmd, &source, &destination, msatoshi, riskfactor*1000, cltv, &fuzz, &seed); |
|
|
|
u8 *req = towire_gossip_getroute_request(cmd, &source, &destination, msatoshi, riskfactor*1000, *cltv, &fuzz, &seed); |
|
|
|
subd_req(ld->gossip, ld->gossip, req, -1, 0, json_getroute_reply, cmd); |
|
|
|
command_still_pending(cmd); |
|
|
|
} |
|
|
@ -479,18 +479,18 @@ static void json_dev_send_timestamp_filter(struct command *cmd, |
|
|
|
{ |
|
|
|
u8 *msg; |
|
|
|
struct pubkey id; |
|
|
|
u32 first, range; |
|
|
|
u32 *first, *range; |
|
|
|
|
|
|
|
if (!param(cmd, buffer, params, |
|
|
|
p_req("id", json_tok_pubkey, &id), |
|
|
|
p_req("first", json_tok_number, &first), |
|
|
|
p_req("range", json_tok_number, &range), |
|
|
|
p_req_tal("first", json_tok_number, &first), |
|
|
|
p_req_tal("range", json_tok_number, &range), |
|
|
|
NULL)) |
|
|
|
return; |
|
|
|
|
|
|
|
log_debug(cmd->ld->log, "Setting timestamp range %u+%u", first, range); |
|
|
|
log_debug(cmd->ld->log, "Setting timestamp range %u+%u", *first, *range); |
|
|
|
/* Tell gossipd, since this is a gossip query. */ |
|
|
|
msg = towire_gossip_send_timestamp_filter(NULL, &id, first, range); |
|
|
|
msg = towire_gossip_send_timestamp_filter(NULL, &id, *first, *range); |
|
|
|
subd_send_msg(cmd->ld->gossip, take(msg)); |
|
|
|
|
|
|
|
command_success(cmd, null_response(cmd)); |
|
|
@ -547,17 +547,17 @@ static void json_dev_query_channel_range(struct command *cmd, |
|
|
|
{ |
|
|
|
u8 *msg; |
|
|
|
struct pubkey id; |
|
|
|
u32 first, num; |
|
|
|
u32 *first, *num; |
|
|
|
|
|
|
|
if (!param(cmd, buffer, params, |
|
|
|
p_req("id", json_tok_pubkey, &id), |
|
|
|
p_req("first", json_tok_number, &first), |
|
|
|
p_req("num", json_tok_number, &num), |
|
|
|
p_req_tal("first", json_tok_number, &first), |
|
|
|
p_req_tal("num", json_tok_number, &num), |
|
|
|
NULL)) |
|
|
|
return; |
|
|
|
|
|
|
|
/* Tell gossipd, since this is a gossip query. */ |
|
|
|
msg = towire_gossip_query_channel_range(cmd, &id, first, num); |
|
|
|
msg = towire_gossip_query_channel_range(cmd, &id, *first, *num); |
|
|
|
subd_req(cmd->ld->gossip, cmd->ld->gossip, |
|
|
|
take(msg), -1, 0, json_channel_range_reply, cmd); |
|
|
|
command_still_pending(cmd); |
|
|
@ -575,14 +575,14 @@ static void json_dev_set_max_scids_encode_size(struct command *cmd, |
|
|
|
const jsmntok_t *params) |
|
|
|
{ |
|
|
|
u8 *msg; |
|
|
|
u32 max; |
|
|
|
u32 *max; |
|
|
|
|
|
|
|
if (!param(cmd, buffer, params, |
|
|
|
p_req("max", json_tok_number, &max), |
|
|
|
p_req_tal("max", json_tok_number, &max), |
|
|
|
NULL)) |
|
|
|
return; |
|
|
|
|
|
|
|
msg = towire_gossip_dev_set_max_scids_encode_size(NULL, max); |
|
|
|
msg = towire_gossip_dev_set_max_scids_encode_size(NULL, *max); |
|
|
|
subd_send_msg(cmd->ld->gossip, take(msg)); |
|
|
|
|
|
|
|
command_success(cmd, null_response(cmd)); |
|
|
|