mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user