mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 21:12:48 +01:00
Merge #8408: Prevent fingerprinting, disk-DoS with compact blocks
1d06e49
Ignore CMPCTBLOCK messages for pruned blocks (Suhas Daftuar)1de2a46
Ignore GETBLOCKTXN requests for unknown blocks (Suhas Daftuar)
This commit is contained in:
commit
842bf8d2c5
@ -5343,7 +5343,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
|||||||
|
|
||||||
BlockMap::iterator it = mapBlockIndex.find(req.blockhash);
|
BlockMap::iterator it = mapBlockIndex.find(req.blockhash);
|
||||||
if (it == mapBlockIndex.end() || !(it->second->nStatus & BLOCK_HAVE_DATA)) {
|
if (it == mapBlockIndex.end() || !(it->second->nStatus & BLOCK_HAVE_DATA)) {
|
||||||
Misbehaving(pfrom->GetId(), 100);
|
|
||||||
LogPrintf("Peer %d sent us a getblocktxn for a block we don't have", pfrom->id);
|
LogPrintf("Peer %d sent us a getblocktxn for a block we don't have", pfrom->id);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -5627,8 +5626,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
|||||||
std::vector<CInv> vInv(1);
|
std::vector<CInv> vInv(1);
|
||||||
vInv[0] = CInv(MSG_BLOCK, cmpctblock.header.GetHash());
|
vInv[0] = CInv(MSG_BLOCK, cmpctblock.header.GetHash());
|
||||||
pfrom->PushMessage(NetMsgType::GETDATA, vInv);
|
pfrom->PushMessage(NetMsgType::GETDATA, vInv);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we're not close to tip yet, give up and let parallel block fetch work its magic
|
// If we're not close to tip yet, give up and let parallel block fetch work its magic
|
||||||
|
Loading…
Reference in New Issue
Block a user