Merge pull request #7079
ebb25f4Limit setAskFor and retire requested entries only when a getdata returns. (Gregory Maxwell)5029698prevent peer flooding request queue for an inv (kazcw)
This commit is contained in:
@@ -4675,6 +4675,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
||||
bool fMissingInputs = false;
|
||||
CValidationState state;
|
||||
|
||||
pfrom->setAskFor.erase(inv.hash);
|
||||
mapAlreadyAskedFor.erase(inv);
|
||||
|
||||
if (!AlreadyHave(inv) && AcceptToMemoryPool(mempool, state, tx, true, &fMissingInputs))
|
||||
@@ -5623,6 +5624,9 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
|
||||
pto->PushMessage("getdata", vGetData);
|
||||
vGetData.clear();
|
||||
}
|
||||
} else {
|
||||
//If we're not going to ask, don't expect a response.
|
||||
pto->setAskFor.erase(inv.hash);
|
||||
}
|
||||
pto->mapAskFor.erase(pto->mapAskFor.begin());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user