mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-23 20:17:17 +00:00
946d4fac5b
* forkID api * merge fork calls * optional param
18 lines
498 B
Go
18 lines
498 B
Go
package commands
|
|
|
|
import (
|
|
"github.com/ledgerwatch/turbo-geth/common"
|
|
"github.com/ledgerwatch/turbo-geth/core/rawdb"
|
|
"github.com/ledgerwatch/turbo-geth/params"
|
|
)
|
|
|
|
func getChainConfig(db rawdb.DatabaseReader) *params.ChainConfig {
|
|
cfg, _ := getChainConfigWithGenesis(db)
|
|
return cfg
|
|
}
|
|
|
|
func getChainConfigWithGenesis(db rawdb.DatabaseReader) (*params.ChainConfig, common.Hash) {
|
|
genesisHash := rawdb.ReadBlockByNumber(db, 0).Hash()
|
|
return rawdb.ReadChainConfig(db, genesisHash), genesisHash
|
|
}
|