MCPcopy Create free account
hub / github.com/ElementsProject/lightning / selected_peer

Function selected_peer

gossipd/seeker.c:96–107  ·  view source on GitHub ↗

Set this peer as our random peer; return false if NULL. */

Source from the content-addressed store, hash-verified

94
95/* Set this peer as our random peer; return false if NULL. */
96static bool selected_peer(struct seeker *seeker, struct peer *peer)
97{
98 if (!peer)
99 return false;
100
101 set_softref(seeker, &seeker->random_peer_softref, peer);
102
103 /* Give it some grace in case we immediately hit timer */
104 seeker->prev_gossip_count
105 = peer->gossip_counter - GOSSIP_SEEKER_INTERVAL(seeker);
106 return true;
107}
108
109#define set_state(seeker, state, peer, ...) \
110 set_state_((seeker), (state), (peer), stringify(state), __VA_ARGS__)

Callers 3

set_state_Function · 0.85
peer_gossip_startupFunction · 0.85
process_scid_probeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected