| 114 | } |
| 115 | |
| 116 | static 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 | |
| 132 | void disconnect_peer(struct peer *peer) |
| 133 | { |
no test coverage detected