diff options
| author | Ross Nicoll <[email protected]> | 2018-01-20 17:56:53 +0000 |
|---|---|---|
| committer | Ross Nicoll <[email protected]> | 2018-09-19 22:11:47 +0100 |
| commit | b6b5ee7502bf646bcd97a9f8fe1b0b8d78e3c9ae (patch) | |
| tree | 0d36b3a80575ee685b4760a3cd1e4fa6f7223e4a /src/rpc/mining.cpp | |
| parent | Replace HMAC_SHA256 with Bitcoin's version (#1438) (diff) | |
| download | discoin-b6b5ee7502bf646bcd97a9f8fe1b0b8d78e3c9ae.tar.xz discoin-b6b5ee7502bf646bcd97a9f8fe1b0b8d78e3c9ae.zip | |
Update RPC tests for Dogecoin (#1431)
* Make most of the RPC tests pass
* Add AUXPoW rpc tests
- Tests the auxpow rpc interface `getauxblock`
- Tests consensus constraints for auxpow:
- Minimum block height
- Valid scrypt proof of work
- Foreign chain ID
Diffstat (limited to 'src/rpc/mining.cpp')
| -rw-r--r-- | src/rpc/mining.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 17e8fd57a..35103e006 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -124,16 +124,17 @@ UniValue generateBlocks(boost::shared_ptr<CReserveScript> coinbaseScript, int nG LOCK(cs_main); IncrementExtraNonce(pblock, chainActive.Tip(), nExtraNonce); } - CAuxPow::initAuxPow(*pblock); - CPureBlockHeader& miningHeader = pblock->auxpow->parentBlock; - while (nMaxTries > 0 && miningHeader.nNonce < nInnerLoopCount && !CheckProofOfWork(miningHeader.GetHash(), pblock->nBits, Params().GetConsensus(nHeight))) { - ++miningHeader.nNonce; + // Dogecoin: Don't mine Aux blocks in regtest + //CAuxPow::initAuxPow(*pblock); + //CPureBlockHeader& miningHeader = pblock->auxpow->parentBlock; + while (nMaxTries > 0 && pblock->nNonce < nInnerLoopCount && !CheckProofOfWork(pblock->GetPoWHash(), pblock->nBits, Params().GetConsensus(nHeight))) { + ++pblock->nNonce; --nMaxTries; } if (nMaxTries == 0) { break; } - if (miningHeader.nNonce == nInnerLoopCount) { + if (pblock->nNonce == nInnerLoopCount) { continue; } std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(*pblock); |