diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-03-29 09:35:05 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-03-29 09:35:11 +0100 |
commit | 55027a8c85e373f8e7e750cc18e97308be31094b (patch) | |
tree | b7b5b9f4229990a69b7edf0f1c26c17e72a65722 /src | |
parent | e9d2e6ed909ccb8c04a66365c70885681b215c19 (diff) | |
parent | a60ab0ba89289433563c4c0993904acbca8c99ff (diff) |
Merge pull request #3973
a60ab0b Make GetAvailableCredit run GetHash() only once per transaction. (Gregory Maxwell)
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wallet.h b/src/wallet.h index e2e89fffe7..487c258a20 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -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); |