diff --git a/TODO b/TODO index 5b37c6bd0b..766e88c6d5 100644 --- a/TODO +++ b/TODO @@ -1,9 +1,9 @@ * soft fork in namecoind: + prevent "name_new stealing" in memory pool + enforce nametx-version also for name *outputs* + + disallow auxpow parent blocks with auxpow - limit DB locks / unique tx - disallow greedy names - - disallow auxpow parent blocks with auxpow - update fee logic? * handle seed nodes / DNS seeds @@ -15,6 +15,8 @@ - P2SH as enforced soft fork (BIP16) - strict BIP30 as enforced soft fork - allow larger blocks (DB locks) + - no need to disallow auxpow parent blocks with auxpow-flag in the version + any more; instead, the auxpow is simply never loaded for them - name_new format change? - more differences??? diff --git a/src/auxpow.h b/src/auxpow.h index dc2cf5ac2e..e7d80eecb2 100644 --- a/src/auxpow.h +++ b/src/auxpow.h @@ -151,6 +151,18 @@ class CAuxPow : public CMerkleTx return parentBlock.GetHash (); } + /** + * Return parent block. This is only used for the temporary parentblock + * auxpow version check. + * @return The parent block. + */ + /* FIXME: Remove after the hardfork. */ + inline const CPureBlockHeader& + getParentBlock () const + { + return parentBlock; + } + /** * Calculate the expected index in the merkle tree. This is also used * for the test-suite. diff --git a/src/main.cpp b/src/main.cpp index efe4bb219c..facb96bf74 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1165,9 +1165,16 @@ bool CheckProofOfWork(const CBlockHeader& block) } /* We have auxpow. Check it. */ + if (!block.nVersion.IsAuxpow()) return error("%s : auxpow on block with non-auxpow version", __func__); + /* Temporary check: Disallow parent blocks with auxpow version. This is + for compatibility with the old client. */ + /* FIXME: Remove this check with a hardfork later on. */ + if (block.auxpow->getParentBlock().nVersion.IsAuxpow()) + return error("%s : auxpow parent block has auxpow version", __func__); + if (!block.auxpow->check(block.GetHash(), block.nVersion.GetChainId())) return error("%s : AUX POW is not valid", __func__); if (!CheckProofOfWork(block.auxpow->getParentBlockHash(), block.nBits))