Feeler connections ported from BTC core, eclipse attack mitigation
This commit is contained in:
21
src/main.cpp
21
src/main.cpp
@@ -6862,10 +6862,16 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
||||
return true;
|
||||
}
|
||||
|
||||
//fprintf(stderr,"netmsg: %s\n", strCommand.c_str());
|
||||
fprintf(stderr,"%s: netmsg: %s from %s\n", __func__, strCommand.c_str(), pfrom->addr.ToString().c_str() );
|
||||
|
||||
if (strCommand == "version") {
|
||||
// Feeler connections exist only to verify if node is online
|
||||
if (pfrom->fFeeler) {
|
||||
assert(pfrom->fInbound == false);
|
||||
pfrom->fDisconnect = true;
|
||||
fprintf(stderr,"%s: disconnecting feelerconn from %s\n", __func__, pfrom->addr.ToString().c_str() );
|
||||
}
|
||||
|
||||
if (strCommand == "version")
|
||||
{
|
||||
// Each connection can only send one version message
|
||||
if (pfrom->nVersion != 0)
|
||||
{
|
||||
@@ -6978,15 +6984,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
||||
}
|
||||
}
|
||||
|
||||
// Do Not Relay alerts
|
||||
/*
|
||||
{
|
||||
LOCK(cs_mapAlerts);
|
||||
BOOST_FOREACH(PAIRTYPE(const uint256, CAlert)& item, mapAlerts)
|
||||
item.second.RelayTo(pfrom);
|
||||
}
|
||||
*/
|
||||
|
||||
pfrom->fSuccessfullyConnected = true;
|
||||
|
||||
string remoteAddr;
|
||||
|
||||
Reference in New Issue
Block a user