Skip to content

Commit 949e700

Browse files
committed
Include vout when copying transaction ID from coin selection
1 parent 8b523f2 commit 949e700

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/qt/coincontroldialog.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ CoinControlDialog::CoinControlDialog(CCoinControl& coin_control, WalletModel* _m
5555
contextMenu->addAction(tr("&Copy address"), this, &CoinControlDialog::copyAddress);
5656
contextMenu->addAction(tr("Copy &label"), this, &CoinControlDialog::copyLabel);
5757
contextMenu->addAction(tr("Copy &amount"), this, &CoinControlDialog::copyAmount);
58-
copyTransactionHashAction = contextMenu->addAction(tr("Copy transaction &ID"), this, &CoinControlDialog::copyTransactionHash);
58+
copyTransactionOutpointAction = contextMenu->addAction(tr("Copy transaction &ID and output index"), this, &CoinControlDialog::copyTransactionOutpoint);
5959
contextMenu->addSeparator();
6060
lockAction = contextMenu->addAction(tr("L&ock unspent"), this, &CoinControlDialog::lockCoin);
6161
unlockAction = contextMenu->addAction(tr("&Unlock unspent"), this, &CoinControlDialog::unlockCoin);
@@ -180,7 +180,7 @@ void CoinControlDialog::showMenu(const QPoint &point)
180180
// disable some items (like Copy Transaction ID, lock, unlock) for tree roots in context menu
181181
if (item->data(COLUMN_ADDRESS, TxHashRole).toString().length() == 64) // transaction hash is 64 characters (this means it is a child node, so it is not a parent node in tree mode)
182182
{
183-
copyTransactionHashAction->setEnabled(true);
183+
copyTransactionOutpointAction->setEnabled(true);
184184
if (model->wallet().isLockedCoin(COutPoint(uint256S(item->data(COLUMN_ADDRESS, TxHashRole).toString().toStdString()), item->data(COLUMN_ADDRESS, VOutRole).toUInt())))
185185
{
186186
lockAction->setEnabled(false);
@@ -194,7 +194,7 @@ void CoinControlDialog::showMenu(const QPoint &point)
194194
}
195195
else // this means click on parent node in tree mode -> disable all
196196
{
197-
copyTransactionHashAction->setEnabled(false);
197+
copyTransactionOutpointAction->setEnabled(false);
198198
lockAction->setEnabled(false);
199199
unlockAction->setEnabled(false);
200200
}
@@ -229,9 +229,10 @@ void CoinControlDialog::copyAddress()
229229
}
230230

231231
// context menu action: copy transaction id
232-
void CoinControlDialog::copyTransactionHash()
232+
void CoinControlDialog::copyTransactionOutpoint()
233233
{
234-
GUIUtil::setClipboard(contextMenuItem->data(COLUMN_ADDRESS, TxHashRole).toString());
234+
const QString outpoint = contextMenuItem->data(COLUMN_ADDRESS, TxHashRole).toString() + ":" + contextMenuItem->data(COLUMN_ADDRESS, VOutRole).toString();
235+
GUIUtil::setClipboard(outpoint);
235236
}
236237

237238
// context menu action: lock coin

src/qt/coincontroldialog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class CoinControlDialog : public QDialog
6363

6464
QMenu *contextMenu;
6565
QTreeWidgetItem *contextMenuItem;
66-
QAction *copyTransactionHashAction;
66+
QAction *copyTransactionOutpointAction;
6767
QAction *lockAction;
6868
QAction *unlockAction;
6969

@@ -95,7 +95,7 @@ private Q_SLOTS:
9595
void copyAmount();
9696
void copyLabel();
9797
void copyAddress();
98-
void copyTransactionHash();
98+
void copyTransactionOutpoint();
9999
void lockCoin();
100100
void unlockCoin();
101101
void clipboardQuantity();

0 commit comments

Comments
 (0)