diff options
| author | langerhans <[email protected]> | 2014-08-18 21:15:52 +0200 |
|---|---|---|
| committer | langerhans <[email protected]> | 2014-08-18 21:15:52 +0200 |
| commit | 5a186d356e749eab678409248599ead9ed5e76bd (patch) | |
| tree | d370ef2c218aa49db7fcca8efb965a4aacffe95f /src/main.cpp | |
| parent | Merge pull request #613 from rnicoll/1.8-dev-coinbase (diff) | |
| parent | check block version for aux blocks properly for version warning (diff) | |
| download | discoin-5a186d356e749eab678409248599ead9ed5e76bd.tar.xz discoin-5a186d356e749eab678409248599ead9ed5e76bd.zip | |
Merge pull request #616 from patricklodder/1.8-dev-auxpow-version
check block version for aux blocks properly for version warning
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index bbc083cec..6cf08aced 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1158,6 +1158,11 @@ void CBlockHeader::SetAuxPow(CAuxPow* pow) auxpow.reset(pow); } +bool IsAuxPowVersion(int nVersion) +{ + return (nVersion == BLOCK_VERSION_AUXPOW_WITH_AUX || nVersion == BLOCK_VERSION_AUXPOW_WITHOUT_AUX); +} + uint256 static GetOrphanRoot(const uint256& hash) { map<uint256, COrphanBlock*>::iterator it = mapOrphanBlocks.find(hash); @@ -2066,10 +2071,9 @@ void static UpdateTip(CBlockIndex *pindexNew) { { int nUpgraded = 0; const CBlockIndex* pindex = chainActive.Tip(); - int nAuxVersion = CBlockHeader::CURRENT_VERSION | (AUXPOW_CHAIN_ID * BLOCK_VERSION_CHAIN_START); for (int i = 0; i < 100 && pindex != NULL; i++) { - if (pindex->nVersion > CBlock::CURRENT_VERSION && pindex->nVersion != nAuxVersion) + if (pindex->nVersion > CBlock::CURRENT_VERSION && !IsAuxPowVersion(pindex->nVersion)) ++nUpgraded; pindex = pindex->pprev; } |