mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 19:50:36 +00:00
26 lines
426 B
Go
26 lines
426 B
Go
package jsonrpc
|
|
|
|
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
|
|
}
|
|
defer tx.Rollback()
|
|
|
|
result, err := cache.ValidateCurrentRoot(ctx, tx)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return result, nil
|
|
}
|