Browse Source

JSONRPC: output from listpeers should be 'id' not 'peerid'.

That's what we use everywhere else.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
parent
commit
2f2cacef0d
  1. 4
      lightningd/peer_control.c
  2. 6
      tests/test_lightningd.py

4
lightningd/peer_control.c

@ -824,7 +824,7 @@ static void gossipd_getpeers_complete(struct subd *gossip, const u8 *msg,
type_to_string(response, struct wireaddr,
&p->addr));
json_array_end(response);
json_add_pubkey(response, "peerid", &p->id);
json_add_pubkey(response, "id", &p->id);
json_add_bool(response, "connected", p->owner != NULL);
if (p->owner)
json_add_string(response, "owner", p->owner->name);
@ -857,7 +857,7 @@ static void gossipd_getpeers_complete(struct subd *gossip, const u8 *msg,
json_object_start(response, NULL);
/* Fake state. */
json_add_string(response, "state", "GOSSIPING");
json_add_pubkey(response, "peerid", ids+i);
json_add_pubkey(response, "id", ids+i);
json_array_start(response, "netaddr");
if (addrs[i].type != ADDR_TYPE_PADDING)
json_add_string(response, NULL,

6
tests/test_lightningd.py

@ -2056,7 +2056,7 @@ class LightningDTests(BaseLightningDTests):
# Fundee remembers, funder doesn't.
assert l1.rpc.getpeer(l2.info['id']) == None
assert l2.rpc.getpeer(l1.info['id'])['peerid'] == l1.info['id']
assert l2.rpc.getpeer(l1.info['id'])['id'] == l1.info['id']
@unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1")
def test_reconnect_signed(self):
@ -2074,8 +2074,8 @@ class LightningDTests(BaseLightningDTests):
l1.rpc.fundchannel(l2.info['id'], 20000)
# They haven't forgotten each other.
assert l1.rpc.getpeer(l2.info['id'])['peerid'] == l2.info['id']
assert l2.rpc.getpeer(l1.info['id'])['peerid'] == l1.info['id']
assert l1.rpc.getpeer(l2.info['id'])['id'] == l2.info['id']
assert l2.rpc.getpeer(l1.info['id'])['id'] == l1.info['id']
# Technically, this is async to fundchannel (and could reconnect first)
l1.daemon.wait_for_logs(['sendrawtx exit 0',

Loading…
Cancel
Save