mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
Index the genesis block with txindex
This commit is contained in:
parent
95602ec21f
commit
ac9966f655
2 changed files with 4 additions and 2 deletions
|
|
@ -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<std::pair<uint256, CDiskTxPos>> vPos;
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue