aboutsummaryrefslogtreecommitdiff
path: root/src/core.h
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-11-11 16:03:51 +1000
committerGavin Andresen <gavinandresen@gmail.com>2013-11-30 15:42:10 +1000
commit0733c1bde69c6ccfe593d2eec775d0ae32fe7140 (patch)
tree05a186706a752322ad057188c5660687162b2246 /src/core.h
parent98c7c8fd1d3712e02be0e9f2eeca7e02aa54d197 (diff)
downloadbitcoin-0733c1bde69c6ccfe593d2eec775d0ae32fe7140.tar.xz
Refactor: move GetValueIn(tx) to tx.GetValueIn()
GetValueIn makes more sense as a CTransaction member.
Diffstat (limited to 'src/core.h')
-rw-r--r--src/core.h9
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());