mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-24 23:46:17 +00:00
feat(triedb): expose backend for custom use (#183)
## Why this should be merged To override the standard trie behavior for custom databases in `core/state/database.go`, custom methods may need to be defined on the backend database. ## How this works Exposes `backend` interface for the API ## How this was tested No tests necessary - isn't used in `libevm`.
This commit is contained in:
parent
2d94327f8d
commit
7342b55267
1 changed files with 5 additions and 0 deletions
|
|
@ -51,6 +51,11 @@ type DBOverride interface {
|
|||
ReaderProvider
|
||||
}
|
||||
|
||||
// Backend returns the underlying backend of the trie database.
|
||||
func (db *Database) Backend() BackendDB {
|
||||
return db.backend
|
||||
}
|
||||
|
||||
func (db *Database) overrideBackend(diskdb ethdb.Database, config *Config) bool {
|
||||
if config.DBOverride == nil {
|
||||
return false
|
||||
|
|
|
|||
Loading…
Reference in a new issue