diff options
author | Jeff Garzik <jgarzik@exmulti.com> | 2011-07-09 10:09:13 -0700 |
---|---|---|
committer | Jeff Garzik <jgarzik@exmulti.com> | 2011-07-09 10:09:13 -0700 |
commit | 354f2dd09487c865f8f0d0d40f66573f764e5a96 (patch) | |
tree | 67abb7bd2f19c5850b0d3dc80bec8f321b2cca47 /src/main.h | |
parent | f08736405e98d0f16ec294606dda782043d5ab3d (diff) | |
parent | aa496b75c2ff3bfb232d1ab023391f62a0183fd5 (diff) | |
download | bitcoin-354f2dd09487c865f8f0d0d40f66573f764e5a96.tar.xz |
Merge pull request #392 from laanwj/antimagic
Remove another magic number: change threshold for nLockTime to constant
Diffstat (limited to 'src/main.h')
-rw-r--r-- | src/main.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.h b/src/main.h index aa74ac5ab3..124c7c2671 100644 --- a/src/main.h +++ b/src/main.h @@ -37,6 +37,8 @@ static const int64 MIN_RELAY_TX_FEE = 10000; static const int64 MAX_MONEY = 21000000 * COIN; inline bool MoneyRange(int64 nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } static const int COINBASE_MATURITY = 100; +// Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp. +static const int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20 1985 UTC #ifdef USE_UPNP static const int fHaveUPnP = true; #else @@ -441,7 +443,7 @@ public: nBlockHeight = nBestHeight; if (nBlockTime == 0) nBlockTime = GetAdjustedTime(); - if ((int64)nLockTime < (nLockTime < 500000000 ? (int64)nBlockHeight : nBlockTime)) + if ((int64)nLockTime < (nLockTime < LOCKTIME_THRESHOLD ? (int64)nBlockHeight : nBlockTime)) return true; BOOST_FOREACH(const CTxIn& txin, vin) if (!txin.IsFinal()) |