aboutsummaryrefslogtreecommitdiff
path: root/src/qt/rpcconsole.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-08-26 22:49:27 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-08-26 22:51:46 +0300
commitb8d45a3c2015568ecc699736bd750f36321d948f (patch)
tree559c5bca01e0f83c522f218ae966125e4fc6f86b /src/qt/rpcconsole.cpp
parent774a4f517cf63df345e6a4852cc0b135b0a9ab76 (diff)
parentab1461d5d36b70fd4982679ac6143c25e7617dbf (diff)
downloadbitcoin-b8d45a3c2015568ecc699736bd750f36321d948f.tar.xz
Merge bitcoin-core/gui#384: Add copy IP/Netmask action for banned peer
ab1461d5d36b70fd4982679ac6143c25e7617dbf qt: Add copy IP/Netmask action for banned peer (Shashwat) Pull request description: This PR adds a Copy IP/Netmask context menu action to the Banned Peers Table. This feature is helpful if a node using GUI might want to alert its peer about a particular malicious user. So it can copy that user’s IP/Netmask and broadcast it to its peers so they can ban it instantly using the setban command in the console. | Master | PR | | ----------- | ----------- | | ![Screenshot_from_2021-07-21_00-01-331](https://user-images.githubusercontent.com/23396902/126377808-bd23bb19-3f47-4f1b-8371-39baa9747bbe.png) | ![Screenshot from 2021-08-20 20-13-28(1)(1)](https://user-images.githubusercontent.com/85434418/130251441-a8d0f816-a2e9-4e63-a22d-94885c5cec98.png) | ACKs for top commit: jarolrod: re-ACK ab1461d hebasto: re-ACK ab1461d5d36b70fd4982679ac6143c25e7617dbf, tested on Linux Mint 20.2 (Qt 5.12.8). Tree-SHA512: a528f089bd4cb5b51fec987550d21c2587459ad80f854b55850bc62c776c21f3fa31052a17e2b0e9e9d0b3468799c8070ed306543730fb7b324f283847151e17
Diffstat (limited to 'src/qt/rpcconsole.cpp')
-rw-r--r--src/qt/rpcconsole.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index ba3eb80efa..0d669a1bba 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -706,6 +706,13 @@ void RPCConsole::setClientModel(ClientModel *model, int bestblock_height, int64_
// create ban table context menu
banTableContextMenu = new QMenu(this);
+ /*: Context menu action to copy the IP/Netmask of a banned peer.
+ IP/Netmask is the combination of a peer's IP address and its Netmask.
+ For IP address see: https://en.wikipedia.org/wiki/IP_address */
+ banTableContextMenu->addAction(tr("&Copy IP/Netmask"), [this] {
+ GUIUtil::copyEntryData(ui->banlistWidget, BanTableModel::Address, Qt::DisplayRole);
+ });
+ banTableContextMenu->addSeparator();
banTableContextMenu->addAction(tr("&Unban"), this, &RPCConsole::unbanSelectedNode);
connect(ui->banlistWidget, &QTableView::customContextMenuRequested, this, &RPCConsole::showBanTableContextMenu);