mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 03:16:45 +01:00
Delete old checkpoints in stateDB automatically
Introduce a constructor parameter for the StateDB called `keep`, which tells how many checkpoints to keep. When doing a new checkpoint, if the number of existing checkpoints exeeds `keep`, the oldest ones will be deleted.
This commit is contained in:
@@ -45,7 +45,7 @@ func TestDebugAPI(t *testing.T) {
|
||||
require.Nil(t, err)
|
||||
|
||||
chainID := uint16(0)
|
||||
sdb, err := statedb.NewStateDB(dir, statedb.TypeSynchronizer, 32, chainID)
|
||||
sdb, err := statedb.NewStateDB(dir, 128, statedb.TypeSynchronizer, 32, chainID)
|
||||
require.Nil(t, err)
|
||||
err = sdb.MakeCheckpoint() // Make a checkpoint to increment the batchNum
|
||||
require.Nil(t, err)
|
||||
|
||||
Reference in New Issue
Block a user