mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-12 04:42:36 -03:00
Merge pull request #3973
a60ab0b
Make GetAvailableCredit run GetHash() only once per transaction. (Gregory Maxwell)
This commit is contained in:
commit
55027a8c85
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue