|
|
@ -375,10 +375,12 @@ public: |
|
|
|
// memory only
|
|
|
|
// memory only
|
|
|
|
mutable bool fDebitCached; |
|
|
|
mutable bool fDebitCached; |
|
|
|
mutable bool fCreditCached; |
|
|
|
mutable bool fCreditCached; |
|
|
|
|
|
|
|
mutable bool fImmatureCreditCached; |
|
|
|
mutable bool fAvailableCreditCached; |
|
|
|
mutable bool fAvailableCreditCached; |
|
|
|
mutable bool fChangeCached; |
|
|
|
mutable bool fChangeCached; |
|
|
|
mutable int64 nDebitCached; |
|
|
|
mutable int64 nDebitCached; |
|
|
|
mutable int64 nCreditCached; |
|
|
|
mutable int64 nCreditCached; |
|
|
|
|
|
|
|
mutable int64 nImmatureCreditCached; |
|
|
|
mutable int64 nAvailableCreditCached; |
|
|
|
mutable int64 nAvailableCreditCached; |
|
|
|
mutable int64 nChangeCached; |
|
|
|
mutable int64 nChangeCached; |
|
|
|
|
|
|
|
|
|
|
@ -416,10 +418,12 @@ public: |
|
|
|
vfSpent.clear(); |
|
|
|
vfSpent.clear(); |
|
|
|
fDebitCached = false; |
|
|
|
fDebitCached = false; |
|
|
|
fCreditCached = false; |
|
|
|
fCreditCached = false; |
|
|
|
|
|
|
|
fImmatureCreditCached = false; |
|
|
|
fAvailableCreditCached = false; |
|
|
|
fAvailableCreditCached = false; |
|
|
|
fChangeCached = false; |
|
|
|
fChangeCached = false; |
|
|
|
nDebitCached = 0; |
|
|
|
nDebitCached = 0; |
|
|
|
nCreditCached = 0; |
|
|
|
nCreditCached = 0; |
|
|
|
|
|
|
|
nImmatureCreditCached = 0; |
|
|
|
nAvailableCreditCached = 0; |
|
|
|
nAvailableCreditCached = 0; |
|
|
|
nChangeCached = 0; |
|
|
|
nChangeCached = 0; |
|
|
|
nOrderPos = -1; |
|
|
|
nOrderPos = -1; |
|
|
@ -563,6 +567,20 @@ public: |
|
|
|
return nCreditCached; |
|
|
|
return nCreditCached; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int64 GetImmatureCredit(bool fUseCache=true) const |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (IsCoinBase() && GetBlocksToMaturity() > 0 && IsInMainChain()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (fUseCache && fImmatureCreditCached) |
|
|
|
|
|
|
|
return nImmatureCreditCached; |
|
|
|
|
|
|
|
nImmatureCreditCached = pwallet->GetCredit(*this); |
|
|
|
|
|
|
|
fImmatureCreditCached = true; |
|
|
|
|
|
|
|
return nImmatureCreditCached; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int64 GetAvailableCredit(bool fUseCache=true) const |
|
|
|
int64 GetAvailableCredit(bool fUseCache=true) const |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Must wait until coinbase is safely deep enough in the chain before valuing it
|
|
|
|
// Must wait until coinbase is safely deep enough in the chain before valuing it
|
|
|
|