Skip to content

Commit fa07b8b

Browse files
author
MarcoFalke
committed
test: Reset global args between test suites
1 parent fba574c commit fa07b8b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/test/setup_common.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ TestChain100Setup::TestChain100Setup()
129129
// CreateAndProcessBlock() does not support building SegWit blocks, so don't activate in these tests.
130130
// TODO: fix the code to support SegWit blocks.
131131
gArgs.ForceSetArg("-segwitheight", "432");
132+
// Need to recreate chainparams
132133
SelectParams(CBaseChainParams::REGTEST);
133134

134135
// Generate a 100-block chain:
@@ -142,12 +143,9 @@ TestChain100Setup::TestChain100Setup()
142143
}
143144
}
144145

145-
//
146146
// Create a new block with just given transactions, coinbase paying to
147147
// scriptPubKey, and try to add it to the current chain.
148-
//
149-
CBlock
150-
TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransaction>& txns, const CScript& scriptPubKey)
148+
CBlock TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransaction>& txns, const CScript& scriptPubKey)
151149
{
152150
const CChainParams& chainparams = Params();
153151
std::unique_ptr<CBlockTemplate> pblocktemplate = BlockAssembler(chainparams).CreateNewBlock(scriptPubKey);
@@ -175,6 +173,7 @@ TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransaction>&
175173

176174
TestChain100Setup::~TestChain100Setup()
177175
{
176+
gArgs.ForceSetArg("-segwitheight", "0");
178177
}
179178

180179

0 commit comments

Comments
 (0)