5735 | @@ -5736,7 +5736,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
5736 | // bandwidth is insufficient.
5737 | const auto new_timeout = std::min(2 * stalling_timeout, BLOCK_STALLING_TIMEOUT_MAX);
5738 | if (stalling_timeout != new_timeout && m_block_stalling_timeout.compare_exchange_strong(stalling_timeout, new_timeout)) {
5739 | - LogPrint(BCLog::NET, "Increased stalling timeout temporarily to %d seconds\n", m_block_stalling_timeout.load().count());
5740 | + LogPrint(BCLog::NET, "Increased stalling timeout temporarily to %d seconds\n", new_timeout.count());
nit (feel free to ignore): it is not recommended to use the count method on a symbol whose type is unknown or whose type can easily change in a refactor. (see comment in util/time.h)
Otherwise, if the type changes to std::chrono::milliseconds, count() will no longer return the number of seconds.
make sense, changed to count_seconds (or did you have something else in mind?)
Ticks<std::chrono::seconds> could be used as well, in theory. The only difference is that count_seconds is more strict at compile-time. count_seconds will refuse to compile if the precision is higher than seconds, while Ticks<std::chrono::seconds> truncates it.
No strong opinion which one to use, unless you need a truncation already, in which case you are better off with Ticks.