Skip to content

Commit 1c043d5

Browse files
committed
fix lock issue for QT node diconnect and RPC disconnectnode
1 parent 932687b commit 1c043d5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/qt/rpcconsole.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ void RPCConsole::disconnectSelectedNode()
687687
QString strNode = GUIUtil::getEntryData(ui->peerWidget, 0, PeerTableModel::Address);
688688
// Find the node, disconnect it and clear the selected node
689689
if (CNode *bannedNode = FindNode(strNode.toStdString())) {
690-
bannedNode->CloseSocketDisconnect();
690+
bannedNode->fDisconnect = true;
691691
clearSelectedNode();
692692
}
693693
}

src/rpcnet.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ UniValue disconnectnode(const UniValue& params, bool fHelp)
231231
if (pNode == NULL)
232232
throw JSONRPCError(RPC_CLIENT_NODE_NOT_CONNECTED, "Node not found in connected nodes");
233233

234-
pNode->CloseSocketDisconnect();
234+
pNode->fDisconnect = true;
235235

236236
return NullUniValue;
237237
}
@@ -519,7 +519,7 @@ UniValue setban(const UniValue& params, bool fHelp)
519519

520520
//disconnect possible nodes
521521
while(CNode *bannedNode = (isSubnet ? FindNode(subNet) : FindNode(netAddr)))
522-
bannedNode->CloseSocketDisconnect();
522+
bannedNode->fDisconnect = true;
523523
}
524524
else if(strCommand == "remove")
525525
{

0 commit comments

Comments
 (0)