mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-25 06:55:32 +01:00
gui: use the stored CSubNet entry when unbanning
The previous code visualized the `CSubNet` object as string, then parsed that string back to `CSubNet`. This is sub-optimal given that the original `CSubNet` object can be used directly instead. This avoids calling `LookupSubNet()` from the GUI. Co-authored-by: furszy <matiasfurszyfer@protonmail.com>
This commit is contained in:
@@ -178,3 +178,9 @@ bool BanTableModel::shouldShow()
|
||||
{
|
||||
return priv->size() > 0;
|
||||
}
|
||||
|
||||
bool BanTableModel::unban(const QModelIndex& index)
|
||||
{
|
||||
CCombinedBan* ban{static_cast<CCombinedBan*>(index.internalPointer())};
|
||||
return ban != nullptr && m_node.unban(ban->subnet);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user