mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 20:03:34 -03:00
Remove CCoinsViewCache::GetValueIn(...)
This commit is contained in:
parent
844d2070a2
commit
b56607a89b
5 changed files with 0 additions and 27 deletions
|
@ -47,8 +47,6 @@ static void CCoinsCaching(benchmark::State& state)
|
||||||
while (state.KeepRunning()) {
|
while (state.KeepRunning()) {
|
||||||
bool success = AreInputsStandard(tx_1, coins);
|
bool success = AreInputsStandard(tx_1, coins);
|
||||||
assert(success);
|
assert(success);
|
||||||
CAmount value = coins.GetValueIn(tx_1);
|
|
||||||
assert(value == (50 + 21 + 22) * COIN);
|
|
||||||
}
|
}
|
||||||
ECC_Stop();
|
ECC_Stop();
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,18 +233,6 @@ unsigned int CCoinsViewCache::GetCacheSize() const {
|
||||||
return cacheCoins.size();
|
return cacheCoins.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
CAmount CCoinsViewCache::GetValueIn(const CTransaction& tx) const
|
|
||||||
{
|
|
||||||
if (tx.IsCoinBase())
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
CAmount nResult = 0;
|
|
||||||
for (unsigned int i = 0; i < tx.vin.size(); i++)
|
|
||||||
nResult += AccessCoin(tx.vin[i].prevout).out.nValue;
|
|
||||||
|
|
||||||
return nResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CCoinsViewCache::HaveInputs(const CTransaction& tx) const
|
bool CCoinsViewCache::HaveInputs(const CTransaction& tx) const
|
||||||
{
|
{
|
||||||
if (!tx.IsCoinBase()) {
|
if (!tx.IsCoinBase()) {
|
||||||
|
|
10
src/coins.h
10
src/coins.h
|
@ -315,16 +315,6 @@ public:
|
||||||
//! Calculate the size of the cache (in bytes)
|
//! Calculate the size of the cache (in bytes)
|
||||||
size_t DynamicMemoryUsage() const;
|
size_t DynamicMemoryUsage() const;
|
||||||
|
|
||||||
/**
|
|
||||||
* Amount of bitcoins coming in to a transaction
|
|
||||||
* Note that lightweight clients may not know anything besides the hash of previous transactions,
|
|
||||||
* so may not be able to calculate this.
|
|
||||||
*
|
|
||||||
* @param[in] tx transaction for which we are checking input total
|
|
||||||
* @return Sum of value of all inputs (scriptSigs)
|
|
||||||
*/
|
|
||||||
CAmount GetValueIn(const CTransaction& tx) const;
|
|
||||||
|
|
||||||
//! Check whether all prevouts of the transaction are present in the UTXO set represented by this view
|
//! Check whether all prevouts of the transaction are present in the UTXO set represented by this view
|
||||||
bool HaveInputs(const CTransaction& tx) const;
|
bool HaveInputs(const CTransaction& tx) const;
|
||||||
|
|
||||||
|
|
|
@ -324,8 +324,6 @@ public:
|
||||||
|
|
||||||
// Return sum of txouts.
|
// Return sum of txouts.
|
||||||
CAmount GetValueOut() const;
|
CAmount GetValueOut() const;
|
||||||
// GetValueIn() is a method on CCoinsViewCache, because
|
|
||||||
// inputs must be known to compute value in.
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the total transaction size in bytes, including witness data.
|
* Get the total transaction size in bytes, including witness data.
|
||||||
|
|
|
@ -305,7 +305,6 @@ BOOST_AUTO_TEST_CASE(test_Get)
|
||||||
t1.vout[0].scriptPubKey << OP_1;
|
t1.vout[0].scriptPubKey << OP_1;
|
||||||
|
|
||||||
BOOST_CHECK(AreInputsStandard(CTransaction(t1), coins));
|
BOOST_CHECK(AreInputsStandard(CTransaction(t1), coins));
|
||||||
BOOST_CHECK_EQUAL(coins.GetValueIn(CTransaction(t1)), (50+21+22)*CENT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CreateCreditAndSpend(const FillableSigningProvider& keystore, const CScript& outscript, CTransactionRef& output, CMutableTransaction& input, bool success = true)
|
static void CreateCreditAndSpend(const FillableSigningProvider& keystore, const CScript& outscript, CTransactionRef& output, CMutableTransaction& input, bool success = true)
|
||||||
|
|
Loading…
Reference in a new issue