routing: Returning channel_id to getroute requests

The new onion uses the `channel_id` instead of the `node_id` of the
next hop to identify where to forward the payment. So we return the
exact channel chosen by the routing algo, to avoid having to look it
up again later.
This commit is contained in:
Christian Decker
2017-04-29 10:52:40 +02:00
parent f24aab1916
commit d87ca4121d
6 changed files with 22 additions and 1 deletions

View File

@@ -445,6 +445,14 @@ void json_add_pubkey(struct json_result *response,
json_add_hex(response, fieldname, der, sizeof(der));
}
void json_add_short_channel_id(struct json_result *response,
const char *fieldname,
const struct short_channel_id *id)
{
char *str = tal_fmt(response, "%d:%d:%d", id->blocknum, id->txnum, id->outnum);
json_add_string(response, fieldname, str);
}
void json_add_object(struct json_result *result, ...)
{
va_list ap;