Skip to content

Commit b2a1e47

Browse files
committed
net_processing: simplify logging statement
Also use count_seconds() instead of count() for type safety.
1 parent 6548ba6 commit b2a1e47

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/net_processing.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,7 +1845,7 @@ void PeerManagerImpl::BlockConnected(const std::shared_ptr<const CBlock>& pblock
18451845
if (stalling_timeout != BLOCK_STALLING_TIMEOUT_DEFAULT) {
18461846
const auto new_timeout = std::max(std::chrono::duration_cast<std::chrono::seconds>(stalling_timeout * 0.85), BLOCK_STALLING_TIMEOUT_DEFAULT);
18471847
if (m_block_stalling_timeout.compare_exchange_strong(stalling_timeout, new_timeout)) {
1848-
LogPrint(BCLog::NET, "Decreased stalling timeout to %d seconds\n", new_timeout.count());
1848+
LogPrint(BCLog::NET, "Decreased stalling timeout to %d seconds\n", count_seconds(new_timeout));
18491849
}
18501850
}
18511851
}
@@ -5736,7 +5736,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
57365736
// bandwidth is insufficient.
57375737
const auto new_timeout = std::min(2 * stalling_timeout, BLOCK_STALLING_TIMEOUT_MAX);
57385738
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());
5739+
LogPrint(BCLog::NET, "Increased stalling timeout temporarily to %d seconds\n", count_seconds(new_timeout));
57405740
}
57415741
return true;
57425742
}

0 commit comments

Comments
 (0)