diff --git a/src/net.cpp b/src/net.cpp index 6062bb6d3309b..1349a24500c6a 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2990,7 +2990,7 @@ CNode::~CNode() delete pfilter; } -void CNode::AskFor(const CInv& inv) +void CNode::AskFor(const CInv& inv, int64_t doubleRequestDelay) { if (mapAskFor.size() > MAPASKFOR_MAX_SZ || setAskFor.size() > SETASKFOR_MAX_SZ) { int64_t nNow = GetTime(); @@ -3028,7 +3028,7 @@ void CNode::AskFor(const CInv& inv) nLastTime = nNow; // Each retry is 2 minutes after the last - nRequestTime = std::max(nRequestTime + 2 * 60 * 1000000, nNow); + nRequestTime = std::max(nRequestTime + doubleRequestDelay, nNow); if (it != mapAlreadyAskedFor.end()) mapAlreadyAskedFor.update(it, nRequestTime); else diff --git a/src/net.h b/src/net.h index 177a0cd107705..d6cd95f520c2f 100644 --- a/src/net.h +++ b/src/net.h @@ -948,7 +948,7 @@ class CNode vBlockHashesToAnnounce.push_back(hash); } - void AskFor(const CInv& inv); + void AskFor(const CInv& inv, int64_t doubleRequestDelay = 2 * 60 * 1000000); void RemoveAskFor(const uint256& hash); void CloseSocketDisconnect(); diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 8eb1c6acd6d8e..f6480d651ef6f 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1781,7 +1781,14 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr } else if (!fAlreadyHave) { bool allowWhileInIBD = allowWhileInIBDObjs.count(inv.type); if (allowWhileInIBD || (!fImporting && !fReindex && !IsInitialBlockDownload())) { - pfrom->AskFor(inv); + int64_t doubleRequestDelay = 2 * 60 * 1000000; + // some messages need to be re-requested faster when the first announcing peer did not answer to GETDATA + switch (inv.type) { + case MSG_QUORUM_RECOVERED_SIG: + doubleRequestDelay = 5 * 1000000; + break; + } + pfrom->AskFor(inv, doubleRequestDelay); } } }