Skip to content

Commit 04b8773

Browse files
committed
[Qt] fix transaction details output-index to reflect vout index
1 parent 9b4d267 commit 04b8773

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/qt/transactionrecord.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,15 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
4747
//
4848
// Credit
4949
//
50-
BOOST_FOREACH(const CTxOut& txout, wtx.tx->vout)
50+
for(unsigned int i = 0; i < wtx.tx->vout.size(); i++)
5151
{
52+
const CTxOut& txout = wtx.tx->vout[i];
5253
isminetype mine = wallet->IsMine(txout);
5354
if(mine)
5455
{
5556
TransactionRecord sub(hash, nTime);
5657
CTxDestination address;
57-
sub.idx = parts.size(); // sequence number
58+
sub.idx = i; // vout index
5859
sub.credit = txout.nValue;
5960
sub.involvesWatchAddress = mine & ISMINE_WATCH_ONLY;
6061
if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*wallet, address))
@@ -118,7 +119,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
118119
{
119120
const CTxOut& txout = wtx.tx->vout[nOut];
120121
TransactionRecord sub(hash, nTime);
121-
sub.idx = parts.size();
122+
sub.idx = nOut;
122123
sub.involvesWatchAddress = involvesWatchAddress;
123124

124125
if(wallet->IsMine(txout))

0 commit comments

Comments
 (0)