diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-11-19 12:52:20 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-11-19 12:52:27 +0100 |
commit | a1907772f021e010cfcf524e01819d62934b348e (patch) | |
tree | c4a2989574e00e69deac3709e66b95d03daceae2 /src/qt/transactiontablemodel.cpp | |
parent | f8e87d74c9b7308905b321a77fb1a7b69b658a01 (diff) | |
parent | b4f3e9c09eab533179be8efe478a0f21c3f83e6c (diff) | |
download | bitcoin-a1907772f021e010cfcf524e01819d62934b348e.tar.xz |
Merge pull request #7051
b4f3e9c ui: Add "Copy raw transaction data" to transaction list context menu (Wladimir J. van der Laan)
Diffstat (limited to 'src/qt/transactiontablemodel.cpp')
-rw-r--r-- | src/qt/transactiontablemodel.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 98ad1a44b6..e8ada9f762 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -13,6 +13,7 @@ #include "transactionrecord.h" #include "walletmodel.h" +#include "core_io.h" #include "main.h" #include "sync.h" #include "uint256.h" @@ -220,6 +221,18 @@ public: } return QString(); } + + QString getTxHex(TransactionRecord *rec) + { + LOCK2(cs_main, wallet->cs_wallet); + std::map<uint256, CWalletTx>::iterator mi = wallet->mapWallet.find(rec->hash); + if(mi != wallet->mapWallet.end()) + { + std::string strHex = EncodeHexTx(static_cast<CTransaction>(mi->second)); + return QString::fromStdString(strHex); + } + return QString(); + } }; TransactionTableModel::TransactionTableModel(const PlatformStyle *platformStyle, CWallet* wallet, WalletModel *parent): @@ -594,6 +607,8 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const return rec->getTxID(); case TxHashRole: return QString::fromStdString(rec->hash.ToString()); + case TxHexRole: + return priv->getTxHex(rec); case ConfirmedRole: return rec->status.countsForBalance; case FormattedAmountRole: |