lightningd: display all addresses in listnodes.

We kept overwriting the first one on marshalling, so any following
addresses were junk.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-08-05 15:19:17 +09:30
committed by Christian Decker
parent 584ee26200
commit c5b5f74965
3 changed files with 32 additions and 1 deletions

View File

@@ -27,7 +27,7 @@ struct gossip_getnodes_entry *fromwire_gossip_getnodes_entry(const tal_t *ctx,
entry->addresses = tal_arr(entry, struct wireaddr, numaddresses);
for (i=0; i<numaddresses; i++) {
/* Gossipd doesn't hand us addresses we can't understand. */
if (!fromwire_wireaddr(pptr, max, entry->addresses)) {
if (!fromwire_wireaddr(pptr, max, &entry->addresses[i])) {
fromwire_fail(pptr, max);
return NULL;
}