diff options
author | Satoshi Nakamoto <satoshin@gmx.com> | 2010-08-04 01:51:34 +0000 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2010-08-04 01:51:34 +0000 |
commit | b34e8c3c369331189c01bcbb7682af9d7daa42cd (patch) | |
tree | e6da267e5bfb4fde1472c32154f73ba7a73b74b7 /main.h | |
parent | 73aa262647ff9948eaf95e83236ec323347e95d0 (diff) | |
download | bitcoin-b34e8c3c369331189c01bcbb7682af9d7daa42cd.tar.xz |
new safety feature displays a warning message and locks down RPC if it detects a problem that may require an upgradev0.3.8
-- version 0.3.8
Diffstat (limited to 'main.h')
-rw-r--r-- | main.h | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -33,6 +33,7 @@ extern const uint256 hashGenesisBlock; extern CBlockIndex* pindexGenesisBlock; extern int nBestHeight; extern CBigNum bnBestChainWork; +extern CBigNum bnBestInvalidWork; extern uint256 hashBestChain; extern CBlockIndex* pindexBest; extern unsigned int nTransactionsUpdated; @@ -80,6 +81,7 @@ void GenerateBitcoins(bool fGenerate); void ThreadBitcoinMiner(void* parg); void BitcoinMiner(); bool IsInitialBlockDownload(); +bool IsLockdown(); @@ -410,15 +412,16 @@ public: return SerializeHash(*this); } - bool IsFinal(int64 nBlockTime=0) const + bool IsFinal(int nBlockHeight=0, int64 nBlockTime=0) const { - // Time based nLockTime implemented in 0.1.6, - // do not use time based until most 0.1.5 nodes have upgraded. + // Time based nLockTime implemented in 0.1.6 if (nLockTime == 0) return true; + if (nBlockHeight == 0) + nBlockHeight = nBestHeight; if (nBlockTime == 0) nBlockTime = GetAdjustedTime(); - if (nLockTime < (nLockTime < 500000000 ? nBestHeight : nBlockTime)) + if (nLockTime < (nLockTime < 500000000 ? nBlockHeight : nBlockTime)) return true; foreach(const CTxIn& txin, vin) if (!txin.IsFinal()) @@ -1046,7 +1049,7 @@ public: } - int64 GetBlockValue(int64 nFees) const; + int64 GetBlockValue(int nHeight, int64 nFees) const; bool DisconnectBlock(CTxDB& txdb, CBlockIndex* pindex); bool ConnectBlock(CTxDB& txdb, CBlockIndex* pindex); bool ReadFromDisk(const CBlockIndex* blockindex, bool fReadTransactions=true); |