- // In any case, if we've been entirely paused for more than double our ping
- // timer, we should have disconnected all sockets by now (and they're probably
- // dead anyway), so disconnect them by calling `timer_tick_occurred()` twice.
- log_trace!(logger, "Awoke after more than double our ping timer, disconnecting peers.");
+ // We detect this by checking if our max-100ms-sleep, above, ran longer than a
+ // full second, at which point we assume sockets may have been killed (they
+ // appear to be at least on some platforms, even if it has only been a second).
+ // Note that we have to take care to not get here just because user event
+ // processing was slow at the top of the loop. For example, the sample client
+ // may call Bitcoin Core RPCs during event handling, which very often takes
+ // more than a handful of seconds to complete, and shouldn't disconnect all our
+ // peers.
+ log_trace!(logger, "100ms sleep took more than a second, disconnecting peers.");