Merge pull request #3662
0542619
Rename IsConfirmed to IsTrusted to better match the intended behavior. (Gregory Maxwell)
This commit is contained in:
commit
6056c87d25
4 changed files with 7 additions and 7 deletions
|
@ -164,7 +164,7 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx)
|
||||||
(wtx.IsCoinBase() ? 1 : 0),
|
(wtx.IsCoinBase() ? 1 : 0),
|
||||||
wtx.nTimeReceived,
|
wtx.nTimeReceived,
|
||||||
idx);
|
idx);
|
||||||
status.confirmed = wtx.IsConfirmed();
|
status.confirmed = wtx.IsTrusted();
|
||||||
status.depth = wtx.GetDepthInMainChain();
|
status.depth = wtx.GetDepthInMainChain();
|
||||||
status.cur_num_blocks = chainActive.Height();
|
status.cur_num_blocks = chainActive.Height();
|
||||||
|
|
||||||
|
|
|
@ -621,7 +621,7 @@ Value getbalance(const Array& params, bool fHelp)
|
||||||
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
|
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
|
||||||
{
|
{
|
||||||
const CWalletTx& wtx = (*it).second;
|
const CWalletTx& wtx = (*it).second;
|
||||||
if (!wtx.IsConfirmed())
|
if (!wtx.IsTrusted())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int64_t allFee;
|
int64_t allFee;
|
||||||
|
|
|
@ -964,7 +964,7 @@ int64_t CWallet::GetBalance() const
|
||||||
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
|
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
|
||||||
{
|
{
|
||||||
const CWalletTx* pcoin = &(*it).second;
|
const CWalletTx* pcoin = &(*it).second;
|
||||||
if (pcoin->IsConfirmed())
|
if (pcoin->IsTrusted())
|
||||||
nTotal += pcoin->GetAvailableCredit();
|
nTotal += pcoin->GetAvailableCredit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -980,7 +980,7 @@ int64_t CWallet::GetUnconfirmedBalance() const
|
||||||
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
|
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
|
||||||
{
|
{
|
||||||
const CWalletTx* pcoin = &(*it).second;
|
const CWalletTx* pcoin = &(*it).second;
|
||||||
if (!IsFinalTx(*pcoin) || !pcoin->IsConfirmed())
|
if (!IsFinalTx(*pcoin) || !pcoin->IsTrusted())
|
||||||
nTotal += pcoin->GetAvailableCredit();
|
nTotal += pcoin->GetAvailableCredit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1015,7 +1015,7 @@ void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed, const
|
||||||
if (!IsFinalTx(*pcoin))
|
if (!IsFinalTx(*pcoin))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (fOnlyConfirmed && !pcoin->IsConfirmed())
|
if (fOnlyConfirmed && !pcoin->IsTrusted())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0)
|
if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0)
|
||||||
|
@ -1710,7 +1710,7 @@ std::map<CTxDestination, int64_t> CWallet::GetAddressBalances()
|
||||||
{
|
{
|
||||||
CWalletTx *pcoin = &walletEntry.second;
|
CWalletTx *pcoin = &walletEntry.second;
|
||||||
|
|
||||||
if (!IsFinalTx(*pcoin) || !pcoin->IsConfirmed())
|
if (!IsFinalTx(*pcoin) || !pcoin->IsTrusted())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0)
|
if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0)
|
||||||
|
|
|
@ -695,7 +695,7 @@ public:
|
||||||
return (GetDebit() > 0);
|
return (GetDebit() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsConfirmed() const
|
bool IsTrusted() const
|
||||||
{
|
{
|
||||||
// Quick answer in most cases
|
// Quick answer in most cases
|
||||||
if (!IsFinalTx(*this))
|
if (!IsFinalTx(*this))
|
||||||
|
|
Loading…
Reference in a new issue