Skip to content

Commit b8d45a3

Browse files
committed
Merge bitcoin-core#384: Add copy IP/Netmask action for banned peer
ab1461d 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 ab1461d, tested on Linux Mint 20.2 (Qt 5.12.8). Tree-SHA512: a528f089bd4cb5b51fec987550d21c2587459ad80f854b55850bc62c776c21f3fa31052a17e2b0e9e9d0b3468799c8070ed306543730fb7b324f283847151e17
2 parents 774a4f5 + ab1461d commit b8d45a3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/qt/rpcconsole.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,13 @@ void RPCConsole::setClientModel(ClientModel *model, int bestblock_height, int64_
706706

707707
// create ban table context menu
708708
banTableContextMenu = new QMenu(this);
709+
/*: Context menu action to copy the IP/Netmask of a banned peer.
710+
IP/Netmask is the combination of a peer's IP address and its Netmask.
711+
For IP address see: https://en.wikipedia.org/wiki/IP_address */
712+
banTableContextMenu->addAction(tr("&Copy IP/Netmask"), [this] {
713+
GUIUtil::copyEntryData(ui->banlistWidget, BanTableModel::Address, Qt::DisplayRole);
714+
});
715+
banTableContextMenu->addSeparator();
709716
banTableContextMenu->addAction(tr("&Unban"), this, &RPCConsole::unbanSelectedNode);
710717
connect(ui->banlistWidget, &QTableView::customContextMenuRequested, this, &RPCConsole::showBanTableContextMenu);
711718

0 commit comments

Comments
 (0)