mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-04 06:12:07 +01:00
net: Disable P2P alert system
This commit is contained in:
28
src/main.cpp
28
src/main.cpp
@@ -4278,32 +4278,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
||||
|
||||
else if (fAlerts && strCommand == "alert")
|
||||
{
|
||||
CAlert alert;
|
||||
vRecv >> alert;
|
||||
|
||||
uint256 alertHash = alert.GetHash();
|
||||
if (pfrom->setKnown.count(alertHash) == 0)
|
||||
{
|
||||
if (alert.ProcessAlert())
|
||||
{
|
||||
// Relay
|
||||
pfrom->setKnown.insert(alertHash);
|
||||
{
|
||||
LOCK(cs_vNodes);
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
alert.RelayTo(pnode);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Small DoS penalty so peers that send us lots of
|
||||
// duplicate/expired/invalid-signature/whatever alerts
|
||||
// eventually get banned.
|
||||
// This isn't a Misbehaving(100) (immediate ban) because the
|
||||
// peer might be an older or different implementation with
|
||||
// a different signature key, etc.
|
||||
Misbehaving(pfrom->GetId(), 10);
|
||||
}
|
||||
}
|
||||
// Alert message handling disabled
|
||||
// See https://bitcoin.org/en/alert/2016-11-01-alert-retirement
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user