Skip to content

Commit

Permalink
Minor AuxPoW fixes
Browse files Browse the repository at this point in the history
Replaced references to Namecoin with Dogecoin
Set chain ID when constructing a new block to be mined
Added assignment overload so that assigning one BlockVersion to another does a full copy.
  • Loading branch information
Ross Nicoll committed Jul 28, 2015
1 parent 3ba610b commit 20278f5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)

/* Initialise the block version. */
pblock->nVersion = CBlockHeader::CURRENT_VERSION;
pblock->nVersion.SetChainId(chainparams.GetConsensus(0).nAuxpowChainId);

// -regtest only: allow overriding block.nVersion with
// -blockversion=N to test forking scenarios
Expand Down
6 changes: 6 additions & 0 deletions src/primitives/pureheader.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ class CBlockVersion
|| (nVersion == 2 && GetChainId() == 0);
}

CBlockVersion& operator=(const CBlockVersion& other)
{
nVersion = other.nVersion;
return *this;
}

CBlockVersion& operator=(const int nBaseVersion)
{
nVersion = (nBaseVersion & 0x000000ff) | (nVersion & 0xffffff00);
Expand Down
4 changes: 2 additions & 2 deletions src/rpcmining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -767,11 +767,11 @@ Value getauxblock(const Array& params, bool fHelp)

if (vNodes.empty() && !Params().MineBlocksOnDemand())
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED,
"Namecoin is not connected!");
"Dogecoin is not connected!");

if (IsInitialBlockDownload() && !Params().MineBlocksOnDemand())
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD,
"Namecoin is downloading blocks...");
"Dogecoin is downloading blocks...");

/* The variables below are used to keep track of created and not yet
submitted auxpow blocks. Lock them, just in case. In principle
Expand Down

0 comments on commit 20278f5

Please sign in to comment.