Browse Source

Merge pull request #6370

6ebac07 Remove ChainParams::DefaultMinerThreads (Wladimir J. van der Laan)
0.13
Wladimir J. van der Laan 10 years ago
parent
commit
fac21df5f0
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 3
      src/chainparams.cpp
  2. 3
      src/chainparams.h
  3. 7
      src/miner.cpp

3
src/chainparams.cpp

@ -50,7 +50,6 @@ public:
pchMessageStart[3] = 0xd9; pchMessageStart[3] = 0xd9;
vAlertPubKey = ParseHex("04fc9702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284"); vAlertPubKey = ParseHex("04fc9702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284");
nDefaultPort = 8333; nDefaultPort = 8333;
nMinerThreads = 0;
nPruneAfterHeight = 100000; nPruneAfterHeight = 100000;
/** /**
@ -147,7 +146,6 @@ public:
pchMessageStart[3] = 0x07; pchMessageStart[3] = 0x07;
vAlertPubKey = ParseHex("04302390343f91cc401d56d68b123028bf52e5fca1939df127f63c6467cdf9c8e2c14b61104cf817d0b780da337893ecc4aaff1309e536162dabbdb45200ca2b0a"); vAlertPubKey = ParseHex("04302390343f91cc401d56d68b123028bf52e5fca1939df127f63c6467cdf9c8e2c14b61104cf817d0b780da337893ecc4aaff1309e536162dabbdb45200ca2b0a");
nDefaultPort = 18333; nDefaultPort = 18333;
nMinerThreads = 0;
nPruneAfterHeight = 1000; nPruneAfterHeight = 1000;
//! Modify the testnet genesis block so the timestamp is valid for a later start. //! Modify the testnet genesis block so the timestamp is valid for a later start.
@ -206,7 +204,6 @@ public:
pchMessageStart[1] = 0xbf; pchMessageStart[1] = 0xbf;
pchMessageStart[2] = 0xb5; pchMessageStart[2] = 0xb5;
pchMessageStart[3] = 0xda; pchMessageStart[3] = 0xda;
nMinerThreads = 1;
genesis.nTime = 1296688602; genesis.nTime = 1296688602;
genesis.nBits = 0x207fffff; genesis.nBits = 0x207fffff;
genesis.nNonce = 2; genesis.nNonce = 2;

3
src/chainparams.h

@ -50,8 +50,6 @@ public:
const std::vector<unsigned char>& AlertKey() const { return vAlertPubKey; } const std::vector<unsigned char>& AlertKey() const { return vAlertPubKey; }
int GetDefaultPort() const { return nDefaultPort; } int GetDefaultPort() const { return nDefaultPort; }
/** Used if GenerateBitcoins is called with a negative number of threads */
int DefaultMinerThreads() const { return nMinerThreads; }
const CBlock& GenesisBlock() const { return genesis; } const CBlock& GenesisBlock() const { return genesis; }
bool RequireRPCPassword() const { return fRequireRPCPassword; } bool RequireRPCPassword() const { return fRequireRPCPassword; }
/** Make miner wait to have peers to avoid wasting work */ /** Make miner wait to have peers to avoid wasting work */
@ -79,7 +77,6 @@ protected:
//! Raw pub key bytes for the broadcast alert signing key. //! Raw pub key bytes for the broadcast alert signing key.
std::vector<unsigned char> vAlertPubKey; std::vector<unsigned char> vAlertPubKey;
int nDefaultPort; int nDefaultPort;
int nMinerThreads;
uint64_t nPruneAfterHeight; uint64_t nPruneAfterHeight;
std::vector<CDNSSeedData> vSeeds; std::vector<CDNSSeedData> vSeeds;
std::vector<unsigned char> base58Prefixes[MAX_BASE58_TYPES]; std::vector<unsigned char> base58Prefixes[MAX_BASE58_TYPES];

7
src/miner.cpp

@ -542,13 +542,8 @@ void GenerateBitcoins(bool fGenerate, int nThreads, const CChainParams& chainpar
{ {
static boost::thread_group* minerThreads = NULL; static boost::thread_group* minerThreads = NULL;
if (nThreads < 0) { if (nThreads < 0)
// In regtest threads defaults to 1
if (Params().DefaultMinerThreads())
nThreads = Params().DefaultMinerThreads();
else
nThreads = GetNumCores(); nThreads = GetNumCores();
}
if (minerThreads != NULL) if (minerThreads != NULL)
{ {

Loading…
Cancel
Save