mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-09 12:12:41 +01:00
index: Fix for indexers skipping genesis block.
This commit is contained in:
@@ -60,7 +60,11 @@ bool BaseIndex::Init()
|
||||
}
|
||||
|
||||
LOCK(cs_main);
|
||||
m_best_block_index = FindForkInGlobalIndex(chainActive, locator);
|
||||
if (locator.IsNull()) {
|
||||
m_best_block_index = nullptr;
|
||||
} else {
|
||||
m_best_block_index = FindForkInGlobalIndex(chainActive, locator);
|
||||
}
|
||||
m_synced = m_best_block_index.load() == chainActive.Tip();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -245,6 +245,9 @@ 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;
|
||||
|
||||
CDiskTxPos pos(pindex->GetBlockPos(), GetSizeOfCompactSize(block.vtx.size()));
|
||||
std::vector<std::pair<uint256, CDiskTxPos>> vPos;
|
||||
vPos.reserve(block.vtx.size());
|
||||
|
||||
Reference in New Issue
Block a user