json_listpeers: use channel connected flag for JSON.

If a channel is active (ie. not onchaind) and has an owner, this should
be equivalent.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-04-26 14:21:01 +09:30
parent a134ca9659
commit e72e54f8d1

View file

@ -764,7 +764,7 @@ static void gossipd_getpeers_complete(struct subd *gossip, const u8 *msg,
connected = true;
else {
channel = peer_active_channel(p);
connected = channel && channel->owner;
connected = channel && channel->connected;
}
json_add_bool(response, "connected", connected);