aboutsummaryrefslogtreecommitdiff
path: root/src/main.h
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-06-27 19:30:39 -0400
committerGavin Andresen <gavinandresen@gmail.com>2012-08-20 10:46:07 -0400
commitde237cbfa4c1aa7d4f9888e650f870a50b77de73 (patch)
tree2b495c7174c0dc696a5ebc18af4485ae2bf8aeed /src/main.h
parent3fcec0d4a0ea9c3cb50a68685a64b2c60946438f (diff)
downloadbitcoin-de237cbfa4c1aa7d4f9888e650f870a50b77de73.tar.xz
Block height in coinbase as a new block rule
"Version 2" blocks are blocks that have nVersion=2 and have the block height as the first item in their coinbase. Block-height-in-the-coinbase is strictly enforced when version=2 blocks are a supermajority in the block chain (750 of the last 1,000 blocks on main net, 51 of 100 for testnet). This does not affect old clients/miners at all, which will continue producing nVersion=1 blocks, and which will continue to be valid.
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.h b/src/main.h
index e88b83d46c..cbc48e05c0 100644
--- a/src/main.h
+++ b/src/main.h
@@ -820,7 +820,7 @@ class CBlock
{
public:
// header
- static const int CURRENT_VERSION=1;
+ static const int CURRENT_VERSION=2;
int nVersion;
uint256 hashPrevBlock;
uint256 hashMerkleRoot;
@@ -1164,6 +1164,12 @@ public:
return pindex->GetMedianTimePast();
}
+ /**
+ * Returns true if there are nRequired or more blocks of minVersion or above
+ * in the last nToCheck blocks, starting at pstart and going backwards.
+ */
+ static bool IsSuperMajority(int minVersion, const CBlockIndex* pstart,
+ unsigned int nRequired, unsigned int nToCheck);
std::string ToString() const