diff options
author | Cory Fields <cory-nospam-@coryfields.com> | 2016-04-18 17:02:43 -0400 |
---|---|---|
committer | Cory Fields <cory-nospam-@coryfields.com> | 2016-05-10 12:28:22 -0400 |
commit | 8b8f87714df8c1e0868e6411c8f09c838ea736ab (patch) | |
tree | 292bad34b25e28719d7537877243bf4c76dfc8dd /src/rpc/net.cpp | |
parent | cca221fd211f63b338bd90afc505bd4a22a01d5d (diff) |
net: make Ban/Unban/ClearBan functionality consistent
- Ban/Unban/ClearBan call uiInterface.BannedListChanged() as necessary
- Ban/Unban/ClearBan sync to disk if the operation is user-invoked
- Mark node for disconnection automatically when banning
- Lock cs_vNodes while setting disconnected
- Don't spin in a tight loop while setting disconnected
Diffstat (limited to 'src/rpc/net.cpp')
-rw-r--r-- | src/rpc/net.cpp | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 320091b9c4..e09af89656 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -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; } |