mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-05 10:32:19 +00:00
bor/consensus: Only write Snapshots to DB for checkpoints (#5369)
This commit is contained in:
parent
0e8d5d41fc
commit
a18c088771
@ -554,12 +554,15 @@ func (c *Bor) snapshot(chain consensus.ChainHeaderReader, number uint64, hash co
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
c.recents.Add(snap.Hash, snap)
|
c.recents.Add(snap.Hash, snap)
|
||||||
|
|
||||||
|
if snap.Number%checkpointInterval == 0 {
|
||||||
// We've generated a new checkpoint snapshot, save to disk
|
// We've generated a new checkpoint snapshot, save to disk
|
||||||
if err = snap.store(c.DB); err != nil {
|
if err = snap.store(c.DB); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
log.Trace("Stored snapshot to disk", "number", snap.Number, "hash", snap.Hash)
|
log.Trace("Stored snapshot to disk", "number", snap.Number, "hash", snap.Hash)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if cont {
|
if cont {
|
||||||
snap = nil
|
snap = nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user