Merge pull request #342 from somegeekintn/master-1.6

Back out caching changes in CWalletTx::GetAmounts (fix #341)
This commit is contained in:
ummjackson 2014-03-17 02:44:56 -04:00
commit ced1831cbe
2 changed files with 1 additions and 23 deletions

View file

@ -664,27 +664,13 @@ void CWalletTx::GetAmounts(list<pair<CTxDestination, int64> >& listReceived,
nFee = nDebit - nValueOut;
}
if (!fMineCached)
vfMine.resize(vout.size());
// Sent/received.
for (unsigned int i = 0; i < vout.size(); i++) {
const CTxOut &txout = vout[i];
bool isMine = false;
bool warnUnkownTX = false;
if (!fMineCached) {
address = CNoDestination();
warnUnkownTX = !ExtractDestinationAndMine(*pwallet, txout.scriptPubKey, address, &isMine);
vfMine[i] = isMine;
}
else {
if (vfMine[i]) {
isMine = true; // already know this is ours, just fetch address
address = CNoDestination();
warnUnkownTX = !ExtractDestination(txout.scriptPubKey, address);
}
}
warnUnkownTX = !ExtractDestinationAndMine(*pwallet, txout.scriptPubKey, address, &isMine);
if (warnUnkownTX) {
printf("CWalletTx::GetAmounts: Unknown transaction type found, txid %s\n", this->GetHash().ToString().c_str());
}
@ -699,8 +685,6 @@ void CWalletTx::GetAmounts(list<pair<CTxDestination, int64> >& listReceived,
if (isMine)
listReceived.push_back(make_pair(address, txout.nValue));
}
fMineCached = true;
}
void CWalletTx::GetAccountAmounts(const string& strAccount, int64& nReceived,

View file

@ -384,8 +384,6 @@ public:
int64 nOrderPos; // position in ordered transaction list
// memory only
mutable std::vector<char> vfMine; // which outputs are mine
mutable bool fMineCached;
mutable bool fDebitCached;
mutable bool fCreditCached;
mutable bool fImmatureCreditCached;
@ -429,8 +427,6 @@ public:
fFromMe = false;
strFromAccount.clear();
vfSpent.clear();
vfMine.clear();
fMineCached = false;
fDebitCached = false;
fCreditCached = false;
fImmatureCreditCached = false;
@ -524,8 +520,6 @@ public:
// make sure balances are recalculated
void MarkDirty()
{
vfMine.clear();
fMineCached = false;
fCreditCached = false;
fAvailableCreditCached = false;
fDebitCached = false;