diff options
Diffstat (limited to 'src/core.h')
-rw-r--r-- | src/core.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core.h b/src/core.h index e31a7e6582..7b4c6af319 100644 --- a/src/core.h +++ b/src/core.h @@ -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()); |