needed type assertion
This commit is contained in:
parent
373d24e26b
commit
907c7132f4
@ -63,12 +63,12 @@ func validate() {
|
||||
ExpiryDuration: time.Minute * time.Duration(CacheExpiryInMins),
|
||||
})
|
||||
|
||||
validator := validator.NewValidator(nil, ethDB)
|
||||
if err = validator.ValidateTrie(stateRoot); err != nil {
|
||||
val := validator.NewValidator(nil, ethDB)
|
||||
if err = val.ValidateTrie(stateRoot); err != nil {
|
||||
log.Fatalln("Error validating state root")
|
||||
}
|
||||
|
||||
stats := ethDB.GetCacheStats()
|
||||
stats := ethDB.(*ipfsethdb.Database).GetCacheStats()
|
||||
log.Debugf("groupcache stats %+v", stats)
|
||||
|
||||
log.Infoln("Successfully validated state root")
|
||||
|
@ -130,7 +130,7 @@ func NewEthBackend(db *postgres.DB, c *Config) (*Backend, error) {
|
||||
ExpiryDuration: time.Minute * time.Duration(gcc.StateDB.CacheExpiryInMins),
|
||||
})
|
||||
|
||||
logStateDBStatsOnTimer(ethDB, gcc)
|
||||
logStateDBStatsOnTimer(ethDB.(*ipfsethdb.Database), gcc)
|
||||
|
||||
return &Backend{
|
||||
DB: db,
|
||||
@ -825,6 +825,7 @@ func (b *Backend) GetHeader(hash common.Hash, height uint64) *types.Header {
|
||||
return header
|
||||
}
|
||||
|
||||
// ValidateTrie validates the trie for the given stateRoot
|
||||
func (b *Backend) ValidateTrie(stateRoot common.Hash) error {
|
||||
return validator.NewValidator(nil, b.EthDB).ValidateTrie(stateRoot)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user