fix lock issue for QT node diconnect and RPC disconnectnode

This commit is contained in:
Jonas Schnelli 2015-06-19 16:32:22 +02:00
parent 932687bc10
commit 1c043d5672
2 changed files with 3 additions and 3 deletions

View file

@ -687,7 +687,7 @@ void RPCConsole::disconnectSelectedNode()
QString strNode = GUIUtil::getEntryData(ui->peerWidget, 0, PeerTableModel::Address); QString strNode = GUIUtil::getEntryData(ui->peerWidget, 0, PeerTableModel::Address);
// Find the node, disconnect it and clear the selected node // Find the node, disconnect it and clear the selected node
if (CNode *bannedNode = FindNode(strNode.toStdString())) { if (CNode *bannedNode = FindNode(strNode.toStdString())) {
bannedNode->CloseSocketDisconnect(); bannedNode->fDisconnect = true;
clearSelectedNode(); clearSelectedNode();
} }
} }

View file

@ -231,7 +231,7 @@ UniValue disconnectnode(const UniValue& params, bool fHelp)
if (pNode == NULL) if (pNode == NULL)
throw JSONRPCError(RPC_CLIENT_NODE_NOT_CONNECTED, "Node not found in connected nodes"); throw JSONRPCError(RPC_CLIENT_NODE_NOT_CONNECTED, "Node not found in connected nodes");
pNode->CloseSocketDisconnect(); pNode->fDisconnect = true;
return NullUniValue; return NullUniValue;
} }
@ -519,7 +519,7 @@ UniValue setban(const UniValue& params, bool fHelp)
//disconnect possible nodes //disconnect possible nodes
while(CNode *bannedNode = (isSubnet ? FindNode(subNet) : FindNode(netAddr))) while(CNode *bannedNode = (isSubnet ? FindNode(subNet) : FindNode(netAddr)))
bannedNode->CloseSocketDisconnect(); bannedNode->fDisconnect = true;
} }
else if(strCommand == "remove") else if(strCommand == "remove")
{ {