mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-22 03:30:35 +00:00
core/rawdb: improve state scheme checking (#28724)
This pull request improves the condition to check if path state scheme is in use. Originally, root node presence was used as the indicator if path scheme is used or not. However due to fact that root node will be deleted during the initial snap sync, this condition is no longer useful. If PersistentStateID is present, it shows that we've already configured for path scheme.
This commit is contained in:
parent
cca94792a4
commit
f469470aff
@ -292,6 +292,11 @@ func ReadStateScheme(db ethdb.Reader) string {
|
||||
if len(blob) != 0 {
|
||||
return PathScheme
|
||||
}
|
||||
// The root node might be deleted during the initial snap sync, check
|
||||
// the persistent state id then.
|
||||
if id := ReadPersistentStateID(db); id != 0 {
|
||||
return PathScheme
|
||||
}
|
||||
// In a hash-based scheme, the genesis state is consistently stored
|
||||
// on the disk. To assess the scheme of the persistent state, it
|
||||
// suffices to inspect the scheme of the genesis state.
|
||||
|
Loading…
Reference in New Issue
Block a user