aboutsummaryrefslogtreecommitdiff
path: root/src/test/blockfilter_index_tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/blockfilter_index_tests.cpp')
-rw-r--r--src/test/blockfilter_index_tests.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/test/blockfilter_index_tests.cpp b/src/test/blockfilter_index_tests.cpp
index 7c502349b3..82b9617384 100644
--- a/src/test/blockfilter_index_tests.cpp
+++ b/src/test/blockfilter_index_tests.cpp
@@ -4,6 +4,7 @@
#include <blockfilter.h>
#include <chainparams.h>
+#include <consensus/merkle.h>
#include <consensus/validation.h>
#include <index/blockfilterindex.h>
#include <node/miner.h>
@@ -18,7 +19,6 @@
using node::BlockAssembler;
using node::CBlockTemplate;
-using node::IncrementExtraNonce;
BOOST_AUTO_TEST_SUITE(blockfilter_index_tests)
@@ -76,9 +76,12 @@ CBlock BuildChainTestingSetup::CreateBlock(const CBlockIndex* prev,
for (const CMutableTransaction& tx : txns) {
block.vtx.push_back(MakeTransactionRef(tx));
}
- // IncrementExtraNonce creates a valid coinbase and merkleRoot
- unsigned int extraNonce = 0;
- IncrementExtraNonce(&block, prev, extraNonce);
+ {
+ CMutableTransaction tx_coinbase{*block.vtx.at(0)};
+ tx_coinbase.vin.at(0).scriptSig = CScript{} << prev->nHeight + 1;
+ block.vtx.at(0) = MakeTransactionRef(std::move(tx_coinbase));
+ block.hashMerkleRoot = BlockMerkleRoot(block);
+ }
while (!CheckProofOfWork(block.GetHash(), block.nBits, chainparams.GetConsensus())) ++block.nNonce;