Memory DoS fixes
This commit is contained in:
@@ -7319,6 +7319,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
||||
return error("message inv size() = %u", vInv.size());
|
||||
}
|
||||
|
||||
bool fBlocksOnly = GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY);
|
||||
|
||||
LOCK(cs_main);
|
||||
|
||||
const uint256* best_block{nullptr};
|
||||
@@ -7349,10 +7351,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
||||
best_block = &inv.hash;
|
||||
}
|
||||
} else {
|
||||
pfrom->AddKnownWTxId(WTxId(inv.hash, inv.hashAux));
|
||||
pfrom->AddInventoryKnown(inv);
|
||||
if (fBlocksOnly)
|
||||
LogPrint("net", "transaction (%s) inv sent in violation of protocol peer=%d\n", inv.hash.ToString(), pfrom->id);
|
||||
else if (!fAlreadyHave && !IsInitialBlockDownload(chainparams.GetConsensus()))
|
||||
else if (!fAlreadyHave && !IsInitialBlockDownload())
|
||||
pfrom->AskFor(inv);
|
||||
}
|
||||
if (pfrom->nSendSize > (SendBufferSize() * 2)) {
|
||||
|
||||
Reference in New Issue
Block a user