From c453bcc9e5fd98ae4aebd1f2fc85192b5fd7410a Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Sun, 5 Jul 2015 17:45:38 +0100 Subject: Adapt AuxPoW to Dogecoin Changed AuxPoW parent block hashing to use Scrypt rather than SHA256 hash. Update chain parameters to match Dogecoin Move CheckProofOfWork into dogecoin.cpp and rename it to CheckAuxPowProofOfWork. Add operator overrides to CBlockVersion so that naive usage operates on the underlying version without chain ID or flags. Modify RPC mining to more closely match existing submitblock() structure --- src/rpcblockchain.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/rpcblockchain.cpp') diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 3d4cfcd21..e4ef47884 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -6,6 +6,7 @@ #include "checkpoints.h" #include "consensus/validation.h" #include "core_io.h" +#include "dogecoin.h" #include "main.h" #include "primitives/transaction.h" #include "rpcserver.h" @@ -53,7 +54,7 @@ double GetDifficulty(const CBlockIndex* blockindex) return dDiff; } -static Object AuxpowToJSON(const CAuxPow& auxpow) +static Object auxpowToJSON(const CAuxPow& auxpow) { Object tx; tx.push_back(Pair("hex", EncodeHexTx(auxpow))); @@ -65,12 +66,12 @@ static Object AuxpowToJSON(const CAuxPow& auxpow) result.push_back(Pair("chainindex", auxpow.nChainIndex)); Array branch; - BOOST_FOREACH(const uint256& node, auxpow.vMerkleBranch) + BOOST_FOREACH (const uint256& node, auxpow.vMerkleBranch) branch.push_back(node.GetHex()); result.push_back(Pair("merklebranch", branch)); branch.clear(); - BOOST_FOREACH(const uint256& node, auxpow.vChainMerkleBranch) + BOOST_FOREACH (const uint256& node, auxpow.vChainMerkleBranch) branch.push_back(node.GetHex()); result.push_back(Pair("chainmerklebranch", branch)); @@ -115,7 +116,7 @@ Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDe result.push_back(Pair("chainwork", blockindex->nChainWork.GetHex())); if (block.auxpow) - result.push_back(Pair("auxpow", AuxpowToJSON(*block.auxpow))); + result.push_back(Pair("auxpow", auxpowToJSON(*block.auxpow))); if (blockindex->pprev) result.push_back(Pair("previousblockhash", blockindex->pprev->GetBlockHash().GetHex())); -- cgit v1.2.3