diff --git a/src/bench/ccoins_caching.cpp b/src/bench/ccoins_caching.cpp --- a/src/bench/ccoins_caching.cpp +++ b/src/bench/ccoins_caching.cpp @@ -46,8 +46,6 @@ bool success = AreInputsStandard(t, coins, STANDARD_SCRIPT_VERIFY_FLAGS); assert(success); - Amount value = coins.GetValueIn(t); - assert(value == (50 + 21 + 22) * COIN); } ECC_Stop(); } diff --git a/src/coins.h b/src/coins.h --- a/src/coins.h +++ b/src/coins.h @@ -312,16 +312,6 @@ //! Calculate the size of the cache (in bytes) 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) - */ - Amount GetValueIn(const CTransaction &tx) const; - //! Check whether all prevouts of the transaction are present in the UTXO //! set represented by this view bool HaveInputs(const CTransaction &tx) const; diff --git a/src/coins.cpp b/src/coins.cpp --- a/src/coins.cpp +++ b/src/coins.cpp @@ -287,19 +287,6 @@ return cacheCoins.size(); } -Amount CCoinsViewCache::GetValueIn(const CTransaction &tx) const { - if (tx.IsCoinBase()) { - return Amount::zero(); - } - - Amount nResult = Amount::zero(); - for (size_t i = 0; i < tx.vin.size(); i++) { - nResult += AccessCoin(tx.vin[i].prevout).GetTxOut().nValue; - } - - return nResult; -} - bool CCoinsViewCache::HaveInputs(const CTransaction &tx) const { if (tx.IsCoinBase()) { return true; diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -263,8 +263,6 @@ // Return sum of txouts. Amount GetValueOut() const; - // GetValueIn() is a method on CCoinsViewCache, because - // inputs must be known to compute value in. /** * Get the total transaction size in bytes. diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -300,8 +300,6 @@ BOOST_CHECK(AreInputsStandard(CTransaction(t1), coins, STANDARD_SCRIPT_VERIFY_FLAGS)); - BOOST_CHECK_EQUAL(coins.GetValueIn(CTransaction(t1)), - (50 + 21 + 22) * CENT); } static void CreateCreditAndSpend(const FillableSigningProvider &keystore,