mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
core/rawdb: update
This commit is contained in:
parent
da9ebaea44
commit
8afbdfa436
1 changed files with 3 additions and 4 deletions
|
|
@ -315,8 +315,8 @@ func (f *Freezer) TruncateTailBlocks(tailBlock uint64) (uint64, error) {
|
||||||
if old >= tailBlock {
|
if old >= tailBlock {
|
||||||
return old, nil
|
return old, nil
|
||||||
}
|
}
|
||||||
for kind, table := range f.tables {
|
for _, table := range f.tables {
|
||||||
if kind == ChainFreezerBodiesTable || kind == ChainFreezerReceiptTable {
|
if table.config.prunable {
|
||||||
if err := table.truncateTail(tailBlock); err != nil {
|
if err := table.truncateTail(tailBlock); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
@ -372,12 +372,11 @@ func (f *Freezer) validate() error {
|
||||||
head uint64
|
head uint64
|
||||||
prunedTail *uint64
|
prunedTail *uint64
|
||||||
)
|
)
|
||||||
// hack to get the head
|
// get any head value
|
||||||
for _, table := range f.tables {
|
for _, table := range f.tables {
|
||||||
head = table.items.Load()
|
head = table.items.Load()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
for kind, table := range f.tables {
|
for kind, table := range f.tables {
|
||||||
// all tables have to have the same head
|
// all tables have to have the same head
|
||||||
if head != table.items.Load() {
|
if head != table.items.Load() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue