Allow one change out in list transactions

This commit is contained in:
jl777
2018-12-10 11:46:51 -11:00
parent 5f162b1a9d
commit 3b4ee13f94

View File

@@ -1304,7 +1304,7 @@ CWallet::TxItems CWallet::OrderedTxItems(std::list<CAccountingEntry>& acentries,
{ {
CWalletTx* wtx = &((*it).second); CWalletTx* wtx = &((*it).second);
txOrdered.insert(make_pair(wtx->nOrderPos, TxPair(wtx, (CAccountingEntry*)0))); txOrdered.insert(make_pair(wtx->nOrderPos, TxPair(wtx, (CAccountingEntry*)0)));
fprintf(stderr,"ordered iter.%d %s\n",(int32_t)wtx->nOrderPos,wtx->GetHash().GetHex().c_str()); //fprintf(stderr,"ordered iter.%d %s\n",(int32_t)wtx->nOrderPos,wtx->GetHash().GetHex().c_str());
} }
acentries.clear(); acentries.clear();
walletdb.ListAccountCreditDebit(strAccount, acentries); walletdb.ListAccountCreditDebit(strAccount, acentries);
@@ -2522,6 +2522,7 @@ void CWalletTx::GetAmounts(list<COutputEntry>& listReceived,
} }
// Sent/received. // Sent/received.
int32_t oneshot = 0;
for (unsigned int i = 0; i < vout.size(); ++i) for (unsigned int i = 0; i < vout.size(); ++i)
{ {
const CTxOut& txout = vout[i]; const CTxOut& txout = vout[i];
@@ -2533,11 +2534,14 @@ void CWalletTx::GetAmounts(list<COutputEntry>& listReceived,
{ {
// Don't report 'change' txouts // Don't report 'change' txouts
if (!(filter & ISMINE_CHANGE) && pwallet->IsChange(txout)) if (!(filter & ISMINE_CHANGE) && pwallet->IsChange(txout))
{
if ( oneshot++ > 1 )
{ {
fprintf(stderr,"skip change vout\n"); fprintf(stderr,"skip change vout\n");
continue; continue;
} }
} }
}
else if (!(fIsMine & filter)) else if (!(fIsMine & filter))
{ {
fprintf(stderr,"skip filtered vout %d %d\n",(int32_t)fIsMine,(int32_t)filter); fprintf(stderr,"skip filtered vout %d %d\n",(int32_t)fIsMine,(int32_t)filter);