Skip to content

Commit 6ebac07

Browse files
committed
Remove ChainParams::DefaultMinerThreads
No longer relevant after #5957. This hack existed because of another hack where the numthreads parameter, on regtest, doubled as how many blocks to generate.
1 parent d0a10c1 commit 6ebac07

File tree

3 files changed

+2
-13
lines changed

3 files changed

+2
-13
lines changed

src/chainparams.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ class CMainParams : public CChainParams {
5050
pchMessageStart[3] = 0xd9;
5151
vAlertPubKey = ParseHex("04fc9702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284");
5252
nDefaultPort = 8333;
53-
nMinerThreads = 0;
5453
nPruneAfterHeight = 100000;
5554

5655
/**
@@ -147,7 +146,6 @@ class CTestNetParams : public CMainParams {
147146
pchMessageStart[3] = 0x07;
148147
vAlertPubKey = ParseHex("04302390343f91cc401d56d68b123028bf52e5fca1939df127f63c6467cdf9c8e2c14b61104cf817d0b780da337893ecc4aaff1309e536162dabbdb45200ca2b0a");
149148
nDefaultPort = 18333;
150-
nMinerThreads = 0;
151149
nPruneAfterHeight = 1000;
152150

153151
//! Modify the testnet genesis block so the timestamp is valid for a later start.
@@ -206,7 +204,6 @@ class CRegTestParams : public CTestNetParams {
206204
pchMessageStart[1] = 0xbf;
207205
pchMessageStart[2] = 0xb5;
208206
pchMessageStart[3] = 0xda;
209-
nMinerThreads = 1;
210207
genesis.nTime = 1296688602;
211208
genesis.nBits = 0x207fffff;
212209
genesis.nNonce = 2;

src/chainparams.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ class CChainParams
5050
const std::vector<unsigned char>& AlertKey() const { return vAlertPubKey; }
5151
int GetDefaultPort() const { return nDefaultPort; }
5252

53-
/** Used if GenerateBitcoins is called with a negative number of threads */
54-
int DefaultMinerThreads() const { return nMinerThreads; }
5553
const CBlock& GenesisBlock() const { return genesis; }
5654
bool RequireRPCPassword() const { return fRequireRPCPassword; }
5755
/** Make miner wait to have peers to avoid wasting work */
@@ -79,7 +77,6 @@ class CChainParams
7977
//! Raw pub key bytes for the broadcast alert signing key.
8078
std::vector<unsigned char> vAlertPubKey;
8179
int nDefaultPort;
82-
int nMinerThreads;
8380
uint64_t nPruneAfterHeight;
8481
std::vector<CDNSSeedData> vSeeds;
8582
std::vector<unsigned char> base58Prefixes[MAX_BASE58_TYPES];

src/miner.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -541,13 +541,8 @@ void GenerateBitcoins(bool fGenerate, int nThreads, const CChainParams& chainpar
541541
{
542542
static boost::thread_group* minerThreads = NULL;
543543

544-
if (nThreads < 0) {
545-
// In regtest threads defaults to 1
546-
if (Params().DefaultMinerThreads())
547-
nThreads = Params().DefaultMinerThreads();
548-
else
549-
nThreads = GetNumCores();
550-
}
544+
if (nThreads < 0)
545+
nThreads = GetNumCores();
551546

552547
if (minerThreads != NULL)
553548
{

0 commit comments

Comments
 (0)