diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-08-21 15:12:45 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-08-21 18:44:52 +0200 |
commit | fad84b7e14ff92465bc17bfdaf1362bcffe092f6 (patch) | |
tree | 9af06b6601bec494bff376c28f5dbaaf9daf3eec /src/test/util/setup_common.cpp | |
parent | fa11ff29803ca4f5fd0035bede697448cff7d960 (diff) | |
download | bitcoin-fad84b7e14ff92465bc17bfdaf1362bcffe092f6.tar.xz |
test: Activate segwit in TestChain100Setup
Diffstat (limited to 'src/test/util/setup_common.cpp')
-rw-r--r-- | src/test/util/setup_common.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index e3d396e96d..bd416380ff 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -196,12 +196,6 @@ TestingSetup::~TestingSetup() TestChain100Setup::TestChain100Setup() { - // CreateAndProcessBlock() does not support building SegWit blocks, so don't activate in these tests. - // TODO: fix the code to support SegWit blocks. - gArgs.ForceSetArg("-segwitheight", "432"); - // Need to recreate chainparams - SelectParams(CBaseChainParams::REGTEST); - // Generate a 100-block chain: coinbaseKey.MakeNewKey(true); CScript scriptPubKey = CScript() << ToByteVector(coinbaseKey.GetPubKey()) << OP_CHECKSIG; @@ -222,12 +216,7 @@ CBlock TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransa for (const CMutableTransaction& tx : txns) { block.vtx.push_back(MakeTransactionRef(tx)); } - // IncrementExtraNonce creates a valid coinbase and merkleRoot - { - LOCK(cs_main); - unsigned int extraNonce = 0; - IncrementExtraNonce(&block, ::ChainActive().Tip(), extraNonce); - } + RegenerateCommitments(block); while (!CheckProofOfWork(block.GetHash(), block.nBits, chainparams.GetConsensus())) ++block.nNonce; |