Commit 87924855 authored by liuyuhang's avatar liuyuhang

del log

parent ce8b86f0
...@@ -599,14 +599,14 @@ func TestPruning(t *testing.T) { ...@@ -599,14 +599,14 @@ func TestPruning(t *testing.T) {
Keys: keys, Keys: keys,
} }
for i := 92; i < len(hashes); i++ { for i := 0; i < len(hashes); i++ {
getDatas.StateHash = hashes[i] getDatas.StateHash = hashes[i]
values := store.Get(getDatas) values := store.Get(getDatas)
value = fmt.Sprintf("vv%d", i) value = fmt.Sprintf("vv%d", i)
if i < 80 { if i < 80 {
for _, v := range values { for _, v := range values {
require.Equal(t, nil, v) require.Equal(t, []byte(nil), v)
} }
} }
......
...@@ -335,6 +335,11 @@ func pruningFirst(db dbm.DB, curHeight int64) { ...@@ -335,6 +335,11 @@ func pruningFirst(db dbm.DB, curHeight int64) {
count = 0 count = 0
} }
} }
if len(mp) > 0 {
deleteOldKV(mp, curHeight, batch)
mp = nil
_ = mp
}
} }
func deleteOldKV(mp map[string][]int64, curHeight int64, batch dbm.Batch) { func deleteOldKV(mp map[string][]int64, curHeight int64, batch dbm.Batch) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment