mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
hooks: Serialize the peer that connected as hook call payload
The format is very similar to the one for `listpeers` except we only list a single channel, and we list the actual netaddr that connected instead of all known from gossip. Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
828d088d60
commit
b5085a9c17
@ -617,6 +617,15 @@ static void
|
||||
peer_connected_serialize(struct peer_connected_hook_payload *payload,
|
||||
struct json_stream *stream)
|
||||
{
|
||||
const struct peer *p = payload->peer;
|
||||
json_object_start(stream, "peer");
|
||||
json_add_pubkey(stream, "id", &p->id);
|
||||
json_add_string(
|
||||
stream, "addr",
|
||||
type_to_string(stream, struct wireaddr_internal, &payload->addr));
|
||||
json_add_hex_talarr(stream, "globalfeatures", p->globalfeatures);
|
||||
json_add_hex_talarr(stream, "localfeatures", p->localfeatures);
|
||||
json_object_end(stream); /* .peer */
|
||||
}
|
||||
|
||||
static struct peer_connected_hook_response *
|
||||
|
Loading…
Reference in New Issue
Block a user