Merge #7906: net: prerequisites for p2p encapsulation changes
5d5e7a0net: No need to export ConnectNode (Cory Fields)e9ed620net: No need to export DumpBanlist (Cory Fields)8b8f877net: make Ban/Unban/ClearBan functionality consistent (Cory Fields)cca221fnet: Drop CNodeRef for AttemptToEvictConnection (Cory Fields)563f375net: use the exposed GetNodeSignals() rather than g_signals directly (Cory Fields)9faa490net: remove unused set (Cory Fields)52cbce2net: don't import std namespace (Cory Fields)
This commit is contained in:
@@ -565,20 +565,12 @@ UniValue setban(const UniValue& params, bool fHelp)
|
||||
absolute = true;
|
||||
|
||||
isSubnet ? CNode::Ban(subNet, BanReasonManuallyAdded, banTime, absolute) : CNode::Ban(netAddr, BanReasonManuallyAdded, banTime, absolute);
|
||||
|
||||
//disconnect possible nodes
|
||||
while(CNode *bannedNode = (isSubnet ? FindNode(subNet) : FindNode(netAddr)))
|
||||
bannedNode->fDisconnect = true;
|
||||
}
|
||||
else if(strCommand == "remove")
|
||||
{
|
||||
if (!( isSubnet ? CNode::Unban(subNet) : CNode::Unban(netAddr) ))
|
||||
throw JSONRPCError(RPC_MISC_ERROR, "Error: Unban failed");
|
||||
}
|
||||
|
||||
DumpBanlist(); //store banlist to disk
|
||||
uiInterface.BannedListChanged();
|
||||
|
||||
return NullUniValue;
|
||||
}
|
||||
|
||||
@@ -624,8 +616,6 @@ UniValue clearbanned(const UniValue& params, bool fHelp)
|
||||
);
|
||||
|
||||
CNode::ClearBanned();
|
||||
DumpBanlist(); //store banlist to disk
|
||||
uiInterface.BannedListChanged();
|
||||
|
||||
return NullUniValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user