|
|
@ -1592,7 +1592,7 @@ CAmount CWalletTx::GetDebit(const isminefilter& filter) const |
|
|
|
debit += nDebitCached; |
|
|
|
debit += nDebitCached; |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
nDebitCached = pwallet->GetDebit(*this, ISMINE_SPENDABLE); |
|
|
|
nDebitCached = pwallet->GetDebit(*tx, ISMINE_SPENDABLE); |
|
|
|
fDebitCached = true; |
|
|
|
fDebitCached = true; |
|
|
|
debit += nDebitCached; |
|
|
|
debit += nDebitCached; |
|
|
|
} |
|
|
|
} |
|
|
@ -1603,7 +1603,7 @@ CAmount CWalletTx::GetDebit(const isminefilter& filter) const |
|
|
|
debit += nWatchDebitCached; |
|
|
|
debit += nWatchDebitCached; |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
nWatchDebitCached = pwallet->GetDebit(*this, ISMINE_WATCH_ONLY); |
|
|
|
nWatchDebitCached = pwallet->GetDebit(*tx, ISMINE_WATCH_ONLY); |
|
|
|
fWatchDebitCached = true; |
|
|
|
fWatchDebitCached = true; |
|
|
|
debit += nWatchDebitCached; |
|
|
|
debit += nWatchDebitCached; |
|
|
|
} |
|
|
|
} |
|
|
@ -1625,7 +1625,7 @@ CAmount CWalletTx::GetCredit(const isminefilter& filter) const |
|
|
|
credit += nCreditCached; |
|
|
|
credit += nCreditCached; |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
nCreditCached = pwallet->GetCredit(*this, ISMINE_SPENDABLE); |
|
|
|
nCreditCached = pwallet->GetCredit(*tx, ISMINE_SPENDABLE); |
|
|
|
fCreditCached = true; |
|
|
|
fCreditCached = true; |
|
|
|
credit += nCreditCached; |
|
|
|
credit += nCreditCached; |
|
|
|
} |
|
|
|
} |
|
|
@ -1636,7 +1636,7 @@ CAmount CWalletTx::GetCredit(const isminefilter& filter) const |
|
|
|
credit += nWatchCreditCached; |
|
|
|
credit += nWatchCreditCached; |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
nWatchCreditCached = pwallet->GetCredit(*this, ISMINE_WATCH_ONLY); |
|
|
|
nWatchCreditCached = pwallet->GetCredit(*tx, ISMINE_WATCH_ONLY); |
|
|
|
fWatchCreditCached = true; |
|
|
|
fWatchCreditCached = true; |
|
|
|
credit += nWatchCreditCached; |
|
|
|
credit += nWatchCreditCached; |
|
|
|
} |
|
|
|
} |
|
|
@ -1650,7 +1650,7 @@ CAmount CWalletTx::GetImmatureCredit(bool fUseCache) const |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (fUseCache && fImmatureCreditCached) |
|
|
|
if (fUseCache && fImmatureCreditCached) |
|
|
|
return nImmatureCreditCached; |
|
|
|
return nImmatureCreditCached; |
|
|
|
nImmatureCreditCached = pwallet->GetCredit(*this, ISMINE_SPENDABLE); |
|
|
|
nImmatureCreditCached = pwallet->GetCredit(*tx, ISMINE_SPENDABLE); |
|
|
|
fImmatureCreditCached = true; |
|
|
|
fImmatureCreditCached = true; |
|
|
|
return nImmatureCreditCached; |
|
|
|
return nImmatureCreditCached; |
|
|
|
} |
|
|
|
} |
|
|
@ -1694,7 +1694,7 @@ CAmount CWalletTx::GetImmatureWatchOnlyCredit(const bool& fUseCache) const |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (fUseCache && fImmatureWatchCreditCached) |
|
|
|
if (fUseCache && fImmatureWatchCreditCached) |
|
|
|
return nImmatureWatchCreditCached; |
|
|
|
return nImmatureWatchCreditCached; |
|
|
|
nImmatureWatchCreditCached = pwallet->GetCredit(*this, ISMINE_WATCH_ONLY); |
|
|
|
nImmatureWatchCreditCached = pwallet->GetCredit(*tx, ISMINE_WATCH_ONLY); |
|
|
|
fImmatureWatchCreditCached = true; |
|
|
|
fImmatureWatchCreditCached = true; |
|
|
|
return nImmatureWatchCreditCached; |
|
|
|
return nImmatureWatchCreditCached; |
|
|
|
} |
|
|
|
} |
|
|
@ -1735,7 +1735,7 @@ CAmount CWalletTx::GetChange() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (fChangeCached) |
|
|
|
if (fChangeCached) |
|
|
|
return nChangeCached; |
|
|
|
return nChangeCached; |
|
|
|
nChangeCached = pwallet->GetChange(*this); |
|
|
|
nChangeCached = pwallet->GetChange(*tx); |
|
|
|
fChangeCached = true; |
|
|
|
fChangeCached = true; |
|
|
|
return nChangeCached; |
|
|
|
return nChangeCached; |
|
|
|
} |
|
|
|
} |
|
|
@ -1749,7 +1749,7 @@ bool CWalletTx::InMempool() const |
|
|
|
bool CWalletTx::IsTrusted() const |
|
|
|
bool CWalletTx::IsTrusted() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Quick answer in most cases
|
|
|
|
// Quick answer in most cases
|
|
|
|
if (!CheckFinalTx(*this)) |
|
|
|
if (!CheckFinalTx(*tx)) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
int nDepth = GetDepthInMainChain(); |
|
|
|
int nDepth = GetDepthInMainChain(); |
|
|
|
if (nDepth >= 1) |
|
|
|
if (nDepth >= 1) |
|
|
@ -1988,7 +1988,7 @@ void CWallet::AvailableCoins(std::vector<COutput>& vCoins, bool fOnlySafe, const |
|
|
|
const uint256& wtxid = it->first; |
|
|
|
const uint256& wtxid = it->first; |
|
|
|
const CWalletTx* pcoin = &(*it).second; |
|
|
|
const CWalletTx* pcoin = &(*it).second; |
|
|
|
|
|
|
|
|
|
|
|
if (!CheckFinalTx(*pcoin)) |
|
|
|
if (!CheckFinalTx(*pcoin->tx)) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
|
|
if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0) |
|
|
|
if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0) |
|
|
@ -2676,7 +2676,7 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletT |
|
|
|
wtxNew.SetTx(MakeTransactionRef(std::move(txNew))); |
|
|
|
wtxNew.SetTx(MakeTransactionRef(std::move(txNew))); |
|
|
|
|
|
|
|
|
|
|
|
// Limit size
|
|
|
|
// Limit size
|
|
|
|
if (GetTransactionWeight(wtxNew) >= MAX_STANDARD_TX_WEIGHT) |
|
|
|
if (GetTransactionWeight(*wtxNew.tx) >= MAX_STANDARD_TX_WEIGHT) |
|
|
|
{ |
|
|
|
{ |
|
|
|
strFailReason = _("Transaction too large"); |
|
|
|
strFailReason = _("Transaction too large"); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|