aboutsummaryrefslogtreecommitdiff
path: root/src/test/txindex_tests.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2019-01-09 14:47:40 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2019-01-09 14:48:11 +0100
commite12a480e40753655124acc15fe4ebfe7bcb3ab99 (patch)
treea785c765a774cb5a25fb2de5de8ffab58a8de522 /src/test/txindex_tests.cpp
parentfdbe7f41c02847276e980724e49865daf7951214 (diff)
parented12d5df1ba52b5ef3dd3799de26bb5e1d3fc654 (diff)
Merge #14085: index: Fix for indexers skipping genesis block.
ed12d5df1ba52b5ef3dd3799de26bb5e1d3fc654 index: Fix for indexers skipping genesis block. (Jim Posen) Pull request description: This fixes a bug where indexers would skip processing of the genesis block. Preserves the current behavior of omitting genesis block transaction from the index. Tree-SHA512: 092fd3d629bf1ef279566217c668cc913a8b8e012d811d0e544231894c49a0c0c179537ac4727c39b9bf407479541745d79c4e118db6f0795a2b848d0fe62cbf
Diffstat (limited to 'src/test/txindex_tests.cpp')
-rw-r--r--src/test/txindex_tests.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/txindex_tests.cpp b/src/test/txindex_tests.cpp
index 43e025c58f..0301901bf0 100644
--- a/src/test/txindex_tests.cpp
+++ b/src/test/txindex_tests.cpp
@@ -2,6 +2,7 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#include <chainparams.h>
#include <index/txindex.h>
#include <script/standard.h>
#include <test/test_bitcoin.h>
@@ -38,6 +39,12 @@ BOOST_FIXTURE_TEST_CASE(txindex_initial_sync, TestChain100Setup)
MilliSleep(100);
}
+ // Check that txindex excludes genesis block transactions.
+ const CBlock& genesis_block = Params().GenesisBlock();
+ for (const auto& txn : genesis_block.vtx) {
+ BOOST_CHECK(!txindex.FindTx(txn->GetHash(), block_hash, tx_disk));
+ }
+
// Check that txindex has all txs that were in the chain before it started.
for (const auto& txn : m_coinbase_txns) {
if (!txindex.FindTx(txn->GetHash(), block_hash, tx_disk)) {