add few comments in code

This commit is contained in:
Liam Lai 2021-12-21 08:47:23 +03:00
parent db58081b8d
commit 5061dd9841
2 changed files with 4 additions and 0 deletions

View file

@ -483,6 +483,7 @@ func (x *XDPoS_v1) snapshot(chain consensus.ChainReader, number uint64, hash com
}
parents = parents[:len(parents)-1]
} else if selfHeader != nil && selfHeader.Hash() == hash {
// it prevents db doesn't have current block info, can be removed by refactor blockchain.go reorg function call.
header = selfHeader
} else {
// No explicit parents (or no more left), reach out to the database

View file

@ -1345,6 +1345,9 @@ func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types.
reorg = block.NumberU64() > currentBlock.NumberU64()
}
// This is the ETH fix. We shall ultimately have this workflow,
// but due to below code has diverged significantly between ETH and XDC, and current issue we have,
// it's best to have it in a different PR with more investigations.
// if reorg {
// // Write the positional metadata for transaction and receipt lookups
// if err := WriteTxLookupEntries(batch, block); err != nil {