diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2012-08-26 21:10:06 +0000 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2012-08-26 21:10:06 +0000 |
commit | 689b878c33e41df0bd692ac3189a0e2089abf8bf (patch) | |
tree | 73de684c4dd8d6c660e49a1b8d69ee7a837a534b /src/main.h | |
parent | b958999af17473300e5b3cd26bd16997e21dd644 (diff) | |
parent | 2d57b561c212a7587aed895792b506807d3923c3 (diff) | |
download | bitcoin-689b878c33e41df0bd692ac3189a0e2089abf8bf.tar.xz |
Merge branch '0.4.x' into 0.5.x
Conflicts:
src/main.cpp
Diffstat (limited to 'src/main.h')
-rw-r--r-- | src/main.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main.h b/src/main.h index 13931d077a..7a8e2d45cf 100644 --- a/src/main.h +++ b/src/main.h @@ -398,6 +398,7 @@ typedef std::map<uint256, std::pair<CTxIndex, CTransaction> > MapPrevTx; class CTransaction { public: + static const int CURRENT_VERSION=1; int nVersion; std::vector<CTxIn> vin; std::vector<CTxOut> vout; @@ -423,7 +424,7 @@ public: void SetNull() { - nVersion = 1; + nVersion = CTransaction::CURRENT_VERSION; vin.clear(); vout.clear(); nLockTime = 0; @@ -836,6 +837,7 @@ class CBlock { public: // header + static const int CURRENT_VERSION=2; int nVersion; uint256 hashPrevBlock; uint256 hashMerkleRoot; @@ -877,7 +879,7 @@ public: void SetNull() { - nVersion = 1; + nVersion = CBlock::CURRENT_VERSION; hashPrevBlock = 0; hashMerkleRoot = 0; nTime = 0; @@ -1206,6 +1208,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 |