diff --git a/src/index/txindex.cpp b/src/index/txindex.cpp index 10bc8419dd..5c546e1e8d 100644 --- a/src/index/txindex.cpp +++ b/src/index/txindex.cpp @@ -246,7 +246,8 @@ bool TxIndex::Init() bool TxIndex::WriteBlock(const CBlock& block, const CBlockIndex* pindex) { // Exclude genesis block transaction because outputs are not spendable. - if (pindex->nHeight == 0) return true; + //ELEMENTS: we do index the genesis block + //if (pindex->nHeight == 0) return true; CDiskTxPos pos(pindex->GetBlockPos(), GetSizeOfCompactSize(block.vtx.size())); std::vector> vPos; diff --git a/src/test/txindex_tests.cpp b/src/test/txindex_tests.cpp index 095371941b..929530f520 100644 --- a/src/test/txindex_tests.cpp +++ b/src/test/txindex_tests.cpp @@ -40,9 +40,10 @@ BOOST_FIXTURE_TEST_CASE(txindex_initial_sync, TestChain100Setup) } // Check that txindex excludes genesis block transactions. + //ELEMENTS: we do include them const CBlock& genesis_block = Params().GenesisBlock(); for (const auto& txn : genesis_block.vtx) { - BOOST_CHECK(!txindex.FindTx(txn->GetHash(), block_hash, tx_disk)); + BOOST_CHECK(txindex.FindTx(txn->GetHash(), block_hash, tx_disk)); } // Check that txindex has all txs that were in the chain before it started.