diff --git a/gossipd/gossipd.c b/gossipd/gossipd.c index e7e07126413b..948c8ba3afe9 100644 --- a/gossipd/gossipd.c +++ b/gossipd/gossipd.c @@ -186,12 +186,13 @@ static struct io_plan *handle_get_address(struct io_conn *conn, { struct node_id id; struct wireaddr *addrs; + struct gossmap *gossmap = gossmap_manage_get_gossmap(daemon->gm); if (!fromwire_gossipd_get_addrs(msg, &id)) master_badmsg(WIRE_GOSSIPD_GET_ADDRS, msg); addrs = gossmap_manage_get_node_addresses(tmpctx, - daemon->gm, + gossmap, &id); daemon_conn_send(daemon->master, diff --git a/gossipd/gossmap_manage.c b/gossipd/gossmap_manage.c index 169f7165c4f5..41cdf46e113d 100644 --- a/gossipd/gossmap_manage.c +++ b/gossipd/gossmap_manage.c @@ -1435,7 +1435,7 @@ void gossmap_manage_tell_lightningd_locals(struct daemon *daemon, } struct wireaddr *gossmap_manage_get_node_addresses(const tal_t *ctx, - struct gossmap_manage *gm, + struct gossmap *gossmap, const struct node_id *node_id) { struct gossmap_node *node; @@ -1447,7 +1447,6 @@ struct wireaddr *gossmap_manage_get_node_addresses(const tal_t *ctx, u8 rgb_color[3], alias[32]; struct tlv_node_ann_tlvs *na_tlvs; struct wireaddr *wireaddrs; - struct gossmap *gossmap = gossmap_manage_get_gossmap(gm); node = gossmap_find_node(gossmap, node_id); if (!node) diff --git a/gossipd/gossmap_manage.h b/gossipd/gossmap_manage.h index 1749f025a83a..c22a6cd14e76 100644 --- a/gossipd/gossmap_manage.h +++ b/gossipd/gossmap_manage.h @@ -105,13 +105,13 @@ void gossmap_manage_new_peer(struct gossmap_manage *gm, /** * gossmap_manage_get_node_addresses: get addresses for this node. * @ctx: the allocation context - * @gm: the gossmap_manage context + * @gossmap: the gossmap * @node_id: the node_id to look up * * Returns NULL if we don't have node_announcement for it. */ struct wireaddr *gossmap_manage_get_node_addresses(const tal_t *ctx, - struct gossmap_manage *gm, + struct gossmap *gossmap, const struct node_id *node_id); /** diff --git a/gossipd/seeker.c b/gossipd/seeker.c index 5d8b62fa7b7b..03fc5d2e2ff1 100644 --- a/gossipd/seeker.c +++ b/gossipd/seeker.c @@ -990,7 +990,7 @@ static struct node_and_addrs *get_random_node(const tal_t *ctx, gossmap_node_get_id(gossmap, node, found_node->id); found_node->addrs = gossmap_manage_get_node_addresses(found_node, - seeker->daemon->gm, + gossmap, found_node->id); if (found_node->addrs && tal_count(found_node->addrs) != 0) return found_node; diff --git a/gossipd/test/run-next_block_range.c b/gossipd/test/run-next_block_range.c index 9de8b17d104f..7bacceb6238b 100644 --- a/gossipd/test/run-next_block_range.c +++ b/gossipd/test/run-next_block_range.c @@ -67,7 +67,7 @@ struct gossmap *gossmap_manage_get_gossmap(struct gossmap_manage *gm UNNEEDED) { fprintf(stderr, "gossmap_manage_get_gossmap called!\n"); abort(); } /* Generated stub for gossmap_manage_get_node_addresses */ struct wireaddr *gossmap_manage_get_node_addresses(const tal_t *ctx UNNEEDED, - struct gossmap_manage *gm UNNEEDED, + struct gossmap *gossmap UNNEEDED, const struct node_id *node_id UNNEEDED) { fprintf(stderr, "gossmap_manage_get_node_addresses called!\n"); abort(); } /* Generated stub for gossmap_max_node_idx */ @@ -92,9 +92,9 @@ struct gossmap_node *gossmap_nth_node(const struct gossmap *map UNNEEDED, const struct gossmap_chan *chan UNNEEDED, int n UNNEEDED) { fprintf(stderr, "gossmap_nth_node called!\n"); abort(); } -/* Generated stub for gossmap_num_nodes */ -size_t gossmap_num_nodes(const struct gossmap *map UNNEEDED) -{ fprintf(stderr, "gossmap_num_nodes called!\n"); abort(); } +/* Generated stub for gossmap_random_node */ +struct gossmap_node *gossmap_random_node(const struct gossmap *map UNNEEDED) +{ fprintf(stderr, "gossmap_random_node called!\n"); abort(); } /* Generated stub for memleak_scan_intmap_ */ void memleak_scan_intmap_(struct htable *memtable UNNEEDED, const struct intmap *m UNNEEDED) { fprintf(stderr, "memleak_scan_intmap_ called!\n"); abort(); } diff --git a/wallet/test/run-db.c b/wallet/test/run-db.c index 67243c7a7b17..cb346dba180f 100644 --- a/wallet/test/run-db.c +++ b/wallet/test/run-db.c @@ -213,7 +213,7 @@ struct chain_coin_mvt *new_coin_wallet_deposit(const tal_t *ctx UNNEEDED, { fprintf(stderr, "new_coin_wallet_deposit called!\n"); abort(); } /* Generated stub for new_inflight */ struct channel_inflight *new_inflight(struct channel *channel UNNEEDED, - struct pubkey *remote_funding UNNEEDED, + struct pubkey *remote_funding STEALS UNNEEDED, const struct bitcoin_outpoint *funding_outpoint UNNEEDED, u32 funding_feerate UNNEEDED, struct amount_sat funding_sat UNNEEDED,