Skip to content

Commit 4486d4e

Browse files
theuniFuzzbawls
authored andcommitted
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
1 parent a5e278d commit 4486d4e

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

src/rpc/net.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -462,20 +462,12 @@ UniValue setban(const UniValue& params, bool fHelp)
462462
absolute = params[3].get_bool();
463463

464464
isSubnet ? CNode::Ban(subNet, BanReasonManuallyAdded, banTime, absolute) : CNode::Ban(netAddr, BanReasonManuallyAdded, banTime, absolute);
465-
466-
//disconnect possible nodes
467-
while(CNode *bannedNode = (isSubnet ? FindNode(subNet) : FindNode(netAddr)))
468-
bannedNode->CloseSocketDisconnect();
469465
}
470466
else if(strCommand == "remove")
471467
{
472468
if (!( isSubnet ? CNode::Unban(subNet) : CNode::Unban(netAddr) ))
473469
throw JSONRPCError(RPC_MISC_ERROR, "Error: Unban failed");
474470
}
475-
476-
DumpBanlist(); //store banlist to disk
477-
uiInterface.BannedListChanged();
478-
479471
return NullUniValue;
480472
}
481473

@@ -532,8 +524,6 @@ UniValue clearbanned(const UniValue& params, bool fHelp)
532524
+ HelpExampleRpc("clearbanned", ""));
533525

534526
CNode::ClearBanned();
535-
DumpBanlist(); //store banlist to disk
536-
uiInterface.BannedListChanged();
537527

538528
return NullUniValue;
539529
}

0 commit comments

Comments
 (0)