mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-22 20:58:09 +02:00
Don't edit Chainparams after initialization
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <chainparams.h>
|
||||
#include <consensus/consensus.h>
|
||||
#include <consensus/params.h>
|
||||
#include <consensus/validation.h>
|
||||
#include <crypto/sha256.h>
|
||||
#include <miner.h>
|
||||
@@ -58,6 +59,9 @@ BasicTestingSetup::BasicTestingSetup(const std::string& chainName)
|
||||
InitSignatureCache();
|
||||
InitScriptExecutionCache();
|
||||
fCheckBlockIndex = true;
|
||||
// CreateAndProcessBlock() does not support building SegWit blocks, so don't activate in these tests.
|
||||
// TODO: fix the code to support SegWit blocks.
|
||||
gArgs.ForceSetArg("-vbparams", strprintf("segwit:0:%d", (int64_t)Consensus::BIP9Deployment::NO_TIMEOUT));
|
||||
SelectParams(chainName);
|
||||
noui_connect();
|
||||
}
|
||||
@@ -128,9 +132,6 @@ TestingSetup::~TestingSetup()
|
||||
|
||||
TestChain100Setup::TestChain100Setup() : TestingSetup(CBaseChainParams::REGTEST)
|
||||
{
|
||||
// CreateAndProcessBlock() does not support building SegWit blocks, so don't activate in these tests.
|
||||
// TODO: fix the code to support SegWit blocks.
|
||||
UpdateVersionBitsParameters(Consensus::DEPLOYMENT_SEGWIT, 0, Consensus::BIP9Deployment::NO_TIMEOUT);
|
||||
// Generate a 100-block chain:
|
||||
coinbaseKey.MakeNewKey(true);
|
||||
CScript scriptPubKey = CScript() << ToByteVector(coinbaseKey.GetPubKey()) << OP_CHECKSIG;
|
||||
|
||||
Reference in New Issue
Block a user