mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 12:46:44 +00:00
Refactor freezerInfo head assignment logic
Removed unnecessary condition for setting head in freezerInfo.
This commit is contained in:
parent
182d798c5f
commit
8d4dd2ae93
1 changed files with 2 additions and 2 deletions
|
|
@ -32,7 +32,7 @@ type tableSize struct {
|
|||
// freezerInfo contains the basic information of the freezer.
|
||||
type freezerInfo struct {
|
||||
name string // The identifier of freezer
|
||||
head uint64 // The number of last stored item in the freezer, valid only if ancients > 0
|
||||
head uint64 // The number of last stored item in the freezer
|
||||
tail uint64 // The number of first stored item in the freezer
|
||||
count uint64 // The number of stored items in the freezer
|
||||
sizes []tableSize // The storage size per table
|
||||
|
|
@ -61,7 +61,6 @@ func inspect(name string, order map[string]freezerTableConfig, reader ethdb.Anci
|
|||
if err != nil {
|
||||
return freezerInfo{}, err
|
||||
}
|
||||
info.ancients = ancients
|
||||
if ancients > 0 {
|
||||
info.head = ancients - 1
|
||||
} else {
|
||||
|
|
@ -74,6 +73,7 @@ func inspect(name string, order map[string]freezerTableConfig, reader ethdb.Anci
|
|||
return freezerInfo{}, err
|
||||
}
|
||||
info.tail = tail
|
||||
|
||||
if ancients == 0 {
|
||||
info.count = 0
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue