File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -1201,19 +1201,9 @@ void RPCConsole::banSelectedNode(int bantime)
1201
1201
if (!clientModel)
1202
1202
return ;
1203
1203
1204
- // Get selected peer addresses
1205
- QList<QModelIndex> nodes = GUIUtil::getEntryData (ui->peerWidget , PeerTableModel::NetNodeId);
1206
- for (int i = 0 ; i < nodes.count (); i++)
1207
- {
1208
- // Get currently selected peer address
1209
- NodeId id = nodes.at (i).data ().toLongLong ();
1210
-
1211
- // Get currently selected peer address
1212
- int detailNodeRow = clientModel->getPeerTableModel ()->getRowByNodeId (id);
1213
- if (detailNodeRow < 0 ) return ;
1214
-
1204
+ for (const auto & peer : GUIUtil::getEntryData (ui->peerWidget , PeerTableModel::NetNodeId)) {
1215
1205
// Find possible nodes, ban it and clear the selected node
1216
- const CNodeCombinedStats * stats = clientModel->getPeerTableModel ()->getNodeStats (detailNodeRow );
1206
+ const CNodeCombinedStats* stats = clientModel->getPeerTableModel ()->getNodeStats (peer. row () );
1217
1207
if (stats) {
1218
1208
m_node.ban (stats->nodeStats .addr , bantime);
1219
1209
m_node.disconnectByAddress (stats->nodeStats .addr );
You can’t perform that action at this time.
0 commit comments