good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit e6887981 authored by Alex Sharov's avatar Alex Sharov Committed by GitHub
Browse files

make sure stage_headers --reset doesn't left garbage in bodies table #4043

parent 533970d3
No related branches found
No related tags found
No related merge requests found
......@@ -1234,6 +1234,13 @@ func TruncateBlocks(ctx context.Context, tx kv.RwTx, blockFrom uint64) error {
}
}
// ensure no grabage records left (it may happen if db is inconsistent)
if err := tx.ForEach(kv.BlockBody, dbutils.EncodeBlockNumber(blockFrom), func(k, _ []byte) error {
return tx.Delete(kv.BlockBody, k, nil)
}); err != nil {
return err
}
return nil
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment