mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-24 12:37:16 +00:00
636586c1b5
draft for now to get some early feedback on approach
25 lines
406 B
Go
25 lines
406 B
Go
package commands
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/ledgerwatch/erigon-lib/kv/kvcache"
|
|
)
|
|
|
|
func (api *ErigonImpl) CacheCheck() (*kvcache.CacheValidationResult, error) {
|
|
cache := api.stateCache
|
|
|
|
ctx := context.Background()
|
|
tx, err := api.db.BeginRo(ctx)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
result, err := cache.ValidateCurrentRoot(ctx, tx)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return result, nil
|
|
}
|