mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
p2p: allow BLOCK_STALLING_TIMEOUT_MAX for addnode peers
This commit is contained in:
parent
eb9730ab65
commit
921b89e1d4
1 changed files with 3 additions and 1 deletions
|
@ -5786,7 +5786,9 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
|
|||
|
||||
// Detect whether we're stalling
|
||||
auto stalling_timeout = m_block_stalling_timeout.load();
|
||||
if (state.m_stalling_since.count() && state.m_stalling_since < current_time - stalling_timeout) {
|
||||
// Allow more time for addnode peers
|
||||
const auto adjusted_timeout{pto->IsManualConn() ? BLOCK_STALLING_TIMEOUT_MAX : stalling_timeout};
|
||||
if (state.m_stalling_since.count() && state.m_stalling_since < current_time - adjusted_timeout) {
|
||||
// Stalling only triggers when the block download window cannot move. During normal steady state,
|
||||
// the download window should be much larger than the to-be-downloaded set of blocks, so disconnection
|
||||
// should only happen during initial block download.
|
||||
|
|
Loading…
Add table
Reference in a new issue