core: extend code comment

This commit is contained in:
Gary Rong 2024-03-11 23:28:30 +08:00
parent e3884f146b
commit 3784c6caee

View file

@ -760,8 +760,10 @@ func (bc *BlockChain) rewindPathHead(root common.Hash) (*types.Header, uint64) {
// block as the new head block. // block as the new head block.
// //
// If the given root is not empty, then the rewind should attempt to pass the specified // If the given root is not empty, then the rewind should attempt to pass the specified
// state root and return the associated block number as well. If the root is deemed // state root and return the associated block number as well. If the root, typically
// impossible to pass, 0 is returned. // representing the state corresponding to snapshot disk layer, is deemed impassable,
// then block number zero is returned, indicating that snapshot recovery is disabled
// and the whole snapshot should be auto-generated in case of head mismatch.
func (bc *BlockChain) rewindHead(root common.Hash) (*types.Header, uint64) { func (bc *BlockChain) rewindHead(root common.Hash) (*types.Header, uint64) {
if bc.triedb.Scheme() == rawdb.PathScheme { if bc.triedb.Scheme() == rawdb.PathScheme {
return bc.rewindPathHead(root) return bc.rewindPathHead(root)