aboutsummaryrefslogtreecommitdiff
path: root/src/test/txindex_tests.cpp
diff options
context:
space:
mode:
authorJim Posen <jim.posen@gmail.com>2018-08-27 12:28:35 -0700
committerJim Posen <jim.posen@gmail.com>2018-08-27 17:03:24 -0700
commited12d5df1ba52b5ef3dd3799de26bb5e1d3fc654 (patch)
tree947882744b34f59d1668b3d4636641c4b9daaed3 /src/test/txindex_tests.cpp
parent0df9b0aed23127acd12d9ed6a008c12be47b1cd9 (diff)
downloadbitcoin-ed12d5df1ba52b5ef3dd3799de26bb5e1d3fc654.tar.xz
index: Fix for indexers skipping genesis block.
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 2a160b9988..b5aa8160ed 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)) {