From: MASM fan Date: Fri, 14 Feb 2014 08:39:24 +0000 (+0400) Subject: Rename IsConfirmed() to IsTrusted() X-Git-Tag: v0.4.4.6-nvc-update2~5 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=cf882ecd08d63682370e8e928a63ed51b9aa6734 Rename IsConfirmed() to IsTrusted() --- diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index 03862ae..8962d18 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -169,7 +169,7 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx) (wtx.IsCoinBase() ? 1 : 0), wtx.nTimeReceived, idx); - status.confirmed = wtx.IsConfirmed(); + status.confirmed = wtx.IsTrusted(); status.depth = wtx.GetDepthInMainChain(); status.cur_num_blocks = nBestHeight; diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index a14c44f..8a1967a 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -564,7 +564,7 @@ Value getbalance(const Array& params, bool fHelp) for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) { const CWalletTx& wtx = (*it).second; - if (!wtx.IsConfirmed()) + if (!wtx.IsTrusted()) continue; int64 allGeneratedImmature, allGeneratedMature, allFee; diff --git a/src/wallet.cpp b/src/wallet.cpp index 85262f7..5957afa 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1005,7 +1005,7 @@ int64 CWallet::GetBalance() const for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) { const CWalletTx* pcoin = &(*it).second; - if (pcoin->IsConfirmed()) + if (pcoin->IsTrusted()) nTotal += pcoin->GetAvailableCredit(); } } @@ -1021,7 +1021,7 @@ int64 CWallet::GetUnconfirmedBalance() const for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) { const CWalletTx* pcoin = &(*it).second; - if (!pcoin->IsFinal() || !pcoin->IsConfirmed()) + if (!pcoin->IsFinal() || !pcoin->IsTrusted()) nTotal += pcoin->GetAvailableCredit(); } } @@ -1057,7 +1057,7 @@ void CWallet::AvailableCoins(vector& vCoins, bool fOnlyConfirmed, const if (!pcoin->IsFinal()) continue; - if (fOnlyConfirmed && !pcoin->IsConfirmed()) + if (fOnlyConfirmed && !pcoin->IsTrusted()) continue; if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0) @@ -2182,7 +2182,7 @@ std::map CWallet::GetAddressBalances() { CWalletTx *pcoin = &walletEntry.second; - if (!pcoin->IsFinal() || !pcoin->IsConfirmed()) + if (!pcoin->IsFinal() || !pcoin->IsTrusted()) continue; if ((pcoin->IsCoinBase() || pcoin->IsCoinStake()) && pcoin->GetBlocksToMaturity() > 0) diff --git a/src/wallet.h b/src/wallet.h index f7a05ad..a78dcee 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -642,16 +642,14 @@ public: return (GetDebit() > 0); } - bool IsConfirmed() const + bool IsTrusted() const { // Quick answer in most cases if (!IsFinal()) return false; if (GetDepthInMainChain() >= 1) return true; - if (!IsFromMe()) // using wtx's cached debit - return false; - if (fConfChange) + if (fConfChange || !IsFromMe()) // using wtx's cached debit return false; // If no confirmations but it's from us, we can still