From 2f2cacef0d3e61bd33dd41ee86915e0abc6b0643 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 17 Jan 2018 10:23:20 +1030 Subject: [PATCH] JSONRPC: output from listpeers should be 'id' not 'peerid'. That's what we use everywhere else. Signed-off-by: Rusty Russell --- lightningd/peer_control.c | 4 ++-- tests/test_lightningd.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index e985a6d99..286533eef 100644 --- a/lightningd/peer_control.c +++ b/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, diff --git a/tests/test_lightningd.py b/tests/test_lightningd.py index edf428d77..54f59844f 100644 --- a/tests/test_lightningd.py +++ b/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',