From b13a9729293ec488404383e7cbf08cf7dd0d7f3a Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Sun, 7 Jan 2018 12:06:25 +0100 Subject: [PATCH] gossip: Do not return empty address-objects for getnodes Signed-off-by: Christian Decker --- lightningd/jsonrpc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lightningd/jsonrpc.c b/lightningd/jsonrpc.c index 75d531589..4cfffff44 100644 --- a/lightningd/jsonrpc.c +++ b/lightningd/jsonrpc.c @@ -386,6 +386,10 @@ void json_add_short_channel_id(struct json_result *response, void json_add_address(struct json_result *response, const char *fieldname, const struct wireaddr *addr) { + /* No need to print padding */ + if (addr->type == ADDR_TYPE_PADDING) + return; + json_object_start(response, fieldname); char *addrstr = tal_arr(response, char, INET6_ADDRSTRLEN); if (addr->type == ADDR_TYPE_IPV4) {