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.
|
// freezerInfo contains the basic information of the freezer.
|
||||||
type freezerInfo struct {
|
type freezerInfo struct {
|
||||||
name string // The identifier of freezer
|
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
|
tail uint64 // The number of first stored item in the freezer
|
||||||
count uint64 // The number of stored items in the freezer
|
count uint64 // The number of stored items in the freezer
|
||||||
sizes []tableSize // The storage size per table
|
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 {
|
if err != nil {
|
||||||
return freezerInfo{}, err
|
return freezerInfo{}, err
|
||||||
}
|
}
|
||||||
info.ancients = ancients
|
|
||||||
if ancients > 0 {
|
if ancients > 0 {
|
||||||
info.head = ancients - 1
|
info.head = ancients - 1
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -74,6 +73,7 @@ func inspect(name string, order map[string]freezerTableConfig, reader ethdb.Anci
|
||||||
return freezerInfo{}, err
|
return freezerInfo{}, err
|
||||||
}
|
}
|
||||||
info.tail = tail
|
info.tail = tail
|
||||||
|
|
||||||
if ancients == 0 {
|
if ancients == 0 {
|
||||||
info.count = 0
|
info.count = 0
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue