[Qt] fix transaction details output-index to reflect vout index
This commit is contained in:
parent
9b4d2673b7
commit
04b877361b
1 changed files with 4 additions and 3 deletions
|
@ -47,14 +47,15 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
|
||||||
//
|
//
|
||||||
// Credit
|
// 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);
|
isminetype mine = wallet->IsMine(txout);
|
||||||
if(mine)
|
if(mine)
|
||||||
{
|
{
|
||||||
TransactionRecord sub(hash, nTime);
|
TransactionRecord sub(hash, nTime);
|
||||||
CTxDestination address;
|
CTxDestination address;
|
||||||
sub.idx = parts.size(); // sequence number
|
sub.idx = i; // vout index
|
||||||
sub.credit = txout.nValue;
|
sub.credit = txout.nValue;
|
||||||
sub.involvesWatchAddress = mine & ISMINE_WATCH_ONLY;
|
sub.involvesWatchAddress = mine & ISMINE_WATCH_ONLY;
|
||||||
if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*wallet, address))
|
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];
|
const CTxOut& txout = wtx.tx->vout[nOut];
|
||||||
TransactionRecord sub(hash, nTime);
|
TransactionRecord sub(hash, nTime);
|
||||||
sub.idx = parts.size();
|
sub.idx = nOut;
|
||||||
sub.involvesWatchAddress = involvesWatchAddress;
|
sub.involvesWatchAddress = involvesWatchAddress;
|
||||||
|
|
||||||
if(wallet->IsMine(txout))
|
if(wallet->IsMine(txout))
|
||||||
|
|
Loading…
Reference in a new issue