mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-11 17:31:35 +00:00
core/rawdb: clarify ReadLastPivotNumber comment (#34773)
clarify that `ReadLastPivotNumber` returns `nil` only when snap sync has never been attempted, since the marker is written during snap sync and never cleared.
This commit is contained in:
parent
acbf699c33
commit
e447a2696d
1 changed files with 3 additions and 1 deletions
|
|
@ -175,7 +175,9 @@ func WriteFinalizedBlockHash(db ethdb.KeyValueWriter, hash common.Hash) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReadLastPivotNumber retrieves the number of the last pivot block. If the node
|
// ReadLastPivotNumber retrieves the number of the last pivot block. If the node
|
||||||
// full synced, the last pivot will always be nil.
|
// has never attempted snap sync, the last pivot will always be nil. The marker
|
||||||
|
// is written during snap sync and never cleared, so that a rollback past the
|
||||||
|
// pivot can re-enable snap sync.
|
||||||
func ReadLastPivotNumber(db ethdb.KeyValueReader) *uint64 {
|
func ReadLastPivotNumber(db ethdb.KeyValueReader) *uint64 {
|
||||||
data, _ := db.Get(lastPivotKey)
|
data, _ := db.Get(lastPivotKey)
|
||||||
if len(data) == 0 {
|
if len(data) == 0 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue