Merge pull request #378 from leofidus/1.7-bitcoin3973

Make GetAvailableCredit run GetHash() only once per transaction.
This commit is contained in:
langerhans 2014-03-29 18:45:40 +01:00
commit 4f0801af8e

View file

@ -620,9 +620,10 @@ public:
return nAvailableCreditCached;
int64_t nCredit = 0;
uint256 hashTx = GetHash();
for (unsigned int i = 0; i < vout.size(); i++)
{
if (!pwallet->IsSpent(GetHash(), i))
if (!pwallet->IsSpent(hashTx, i))
{
const CTxOut &txout = vout[i];
nCredit += pwallet->GetCredit(txout);