From d84d358562a3bcdf48856fdea24511907ff53fd9 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 20 Jul 2018 12:14:44 +0930 Subject: [PATCH] lightningd: fix crash on listpeers. Fixes: #1680 Signed-off-by: Rusty Russell --- lightningd/peer_control.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index bf4e17d27..2f5aab666 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -781,7 +781,7 @@ static void gossipd_getpeers_complete(struct subd *gossip, const u8 *msg, } /* Search gossip reply for this ID, to add extra info. */ - for (size_t i = 0; i < tal_len(nodes); i++) { + for (size_t i = 0; i < tal_count(nodes); i++) { if (pubkey_eq(&nodes[i]->nodeid, &p->id)) { json_add_node_decoration(response, nodes[i]); break;