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. 1
      lightningd/peer_control.c

1
lightningd/peer_control.c

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

Loading…
Cancel
Save