mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-08 11:56:46 +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:
@@ -21,7 +21,7 @@ func TestGetIdx(t *testing.T) {
|
||||
defer assert.NoError(t, os.RemoveAll(dir))
|
||||
|
||||
chainID := uint16(0)
|
||||
sdb, err := NewStateDB(dir, TypeTxSelector, 0, chainID)
|
||||
sdb, err := NewStateDB(dir, 128, TypeTxSelector, 0, chainID)
|
||||
assert.NoError(t, err)
|
||||
|
||||
var sk babyjub.PrivateKey
|
||||
|
||||
Reference in New Issue
Block a user