diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-01-27 16:17:31 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-01-27 16:17:39 +0100 |
commit | d9e4d1d9fbd962ac055b5098901a39766f1a0fdb (patch) | |
tree | 5d7ae51226f5fe8f2b657bb68db8aad7eb6fccc8 /src | |
parent | 9b4d2673b7757fd242b13c972c73897c92a90ce1 (diff) | |
parent | 04b877361be8a457b4d4f7fd2277d73f00e2e61c (diff) |
Merge #9637: [Qt] fix transaction details output-index to reflect vout index
04b8773 [Qt] fix transaction details output-index to reflect vout index (Jonas Schnelli)
Diffstat (limited to 'src')
-rw-r--r-- | src/qt/transactionrecord.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index cbdedbf68b..a9d9b6887e 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -47,14 +47,15 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet * // // Credit // - BOOST_FOREACH(const CTxOut& txout, wtx.tx->vout) + for(unsigned int i = 0; i < wtx.tx->vout.size(); i++) { + const CTxOut& txout = wtx.tx->vout[i]; isminetype mine = wallet->IsMine(txout); if(mine) { TransactionRecord sub(hash, nTime); CTxDestination address; - sub.idx = parts.size(); // sequence number + sub.idx = i; // vout index sub.credit = txout.nValue; sub.involvesWatchAddress = mine & ISMINE_WATCH_ONLY; if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*wallet, address)) @@ -118,7 +119,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet * { const CTxOut& txout = wtx.tx->vout[nOut]; TransactionRecord sub(hash, nTime); - sub.idx = parts.size(); + sub.idx = nOut; sub.involvesWatchAddress = involvesWatchAddress; if(wallet->IsMine(txout)) |