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

Function drain_peer

connectd/multiplex.c:116–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116static void drain_peer(struct peer *peer)
117{
118 assert(tal_count(peer->subds) == 0);
119
120 /* You have five seconds to drain. */
121 peer->draining_state = WRITING_TO_PEER;
122 status_peer_debug(&peer->id, "disconnect_peer: draining with 5 second timer.");
123 notleak(new_reltimer(&peer->daemon->timers,
124 peer->to_peer, time_from_sec(5),
125 close_peer_io_timeout, peer));
126 io_wake(peer->peer_outq);
127
128 /* We will discard what they send us, but listen so we catch closes */
129 io_wake(&peer->peer_in);
130}
131
132void disconnect_peer(struct peer *peer)
133{

Callers 3

disconnect_peerFunction · 0.85
msg_out_dev_disconnectFunction · 0.85
destroy_connected_subdFunction · 0.85

Calls 2

time_from_secFunction · 0.85
io_wakeFunction · 0.85

Tested by

no test coverage detected