aboutsummaryrefslogtreecommitdiff
path: root/main.h
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-08-03 18:25:05 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-08-03 18:25:05 +0000
commit2c06be915de967494920bdbb3096bbb455ccf99f (patch)
treeda4dca822bdb75d871ee8d652b4aa306e62bff20 /main.h
parent6ff5f718b6a67797b2b3bab8905d607ad216ee21 (diff)
new safety feature displays a warning message and locks down RPC if it detects a problem that may require an upgrade
-- version 0.3.8 git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@122 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'main.h')
-rw-r--r--main.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/main.h b/main.h
index c9b2407176..093eb9de55 100644
--- a/main.h
+++ b/main.h
@@ -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);