mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Refactor: move GetValueIn(tx) to tx.GetValueIn()
GetValueIn makes more sense as a CTransaction member.
This commit is contained in:
@@ -14,6 +14,10 @@
|
||||
|
||||
class CTransaction;
|
||||
|
||||
/** No amount larger than this (in satoshi) is valid */
|
||||
static const int64_t MAX_MONEY = 21000000 * COIN;
|
||||
inline bool MoneyRange(int64_t nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
|
||||
|
||||
/** An outpoint - a combination of a transaction hash and an index n into its vout */
|
||||
class COutPoint
|
||||
{
|
||||
@@ -217,6 +221,11 @@ public:
|
||||
uint256 GetHash() const;
|
||||
bool IsNewerThan(const CTransaction& old) const;
|
||||
|
||||
// Return sum of txouts.
|
||||
int64_t GetValueOut() const;
|
||||
// GetValueIn() is a method on CCoinsViewCache, because
|
||||
// inputs must be known to compute value in.
|
||||
|
||||
bool IsCoinBase() const
|
||||
{
|
||||
return (vin.size() == 1 && vin[0].prevout.IsNull());
|
||||
|
||||
Reference in New Issue
Block a user