Browse Source

jsonrpc: Only print netaddr in getpeers when we know it

Fixes #285
Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
parent
commit
89f016f524
  1. 7
      lightningd/peer_control.c

7
lightningd/peer_control.c

@ -842,9 +842,10 @@ static void gossipd_getpeers_complete(struct subd *gossip, const u8 *msg,
list_for_each(&gpa->cmd->ld->peers, p, list) {
json_object_start(response, NULL);
json_add_string(response, "state", peer_state_name(p->state));
json_add_string(response, "netaddr",
type_to_string(response, struct wireaddr,
&p->addr));
if (p->addr.type != ADDR_TYPE_PADDING)
json_add_string(response, "netaddr",
type_to_string(response, struct wireaddr,
&p->addr));
json_add_pubkey(response, "peerid", &p->id);
json_add_bool(response, "connected", p->owner != NULL);
if (p->owner)

Loading…
Cancel
Save