Faster re-requesting of recovered sigs
These are quite important and waiting for 2 minutes when the first peer did not send it is not acceptable.
This commit is contained in:
parent
c38f889e77
commit
316b6bf0de
@ -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
|
||||
|
@ -948,7 +948,7 @@ public:
|
||||
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();
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user