mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
gossip: Do not return empty address-objects for getnodes
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
0865c9f012
commit
b13a972929
@ -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,
|
void json_add_address(struct json_result *response, const char *fieldname,
|
||||||
const struct wireaddr *addr)
|
const struct wireaddr *addr)
|
||||||
{
|
{
|
||||||
|
/* No need to print padding */
|
||||||
|
if (addr->type == ADDR_TYPE_PADDING)
|
||||||
|
return;
|
||||||
|
|
||||||
json_object_start(response, fieldname);
|
json_object_start(response, fieldname);
|
||||||
char *addrstr = tal_arr(response, char, INET6_ADDRSTRLEN);
|
char *addrstr = tal_arr(response, char, INET6_ADDRSTRLEN);
|
||||||
if (addr->type == ADDR_TYPE_IPV4) {
|
if (addr->type == ADDR_TYPE_IPV4) {
|
||||||
|
Loading…
Reference in New Issue
Block a user