2020-10-03 08:07:49 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
2020-10-16 12:15:10 +00:00
|
|
|
"github.com/ledgerwatch/turbo-geth/common"
|
2020-10-03 08:07:49 +00:00
|
|
|
"github.com/ledgerwatch/turbo-geth/core/rawdb"
|
|
|
|
"github.com/ledgerwatch/turbo-geth/params"
|
|
|
|
)
|
|
|
|
|
|
|
|
func getChainConfig(db rawdb.DatabaseReader) *params.ChainConfig {
|
2020-10-16 12:15:10 +00:00
|
|
|
cfg, _ := getChainConfigWithGenesis(db)
|
|
|
|
return cfg
|
|
|
|
}
|
|
|
|
|
|
|
|
func getChainConfigWithGenesis(db rawdb.DatabaseReader) (*params.ChainConfig, common.Hash) {
|
2020-10-03 08:07:49 +00:00
|
|
|
genesisHash := rawdb.ReadBlockByNumber(db, 0).Hash()
|
2020-10-16 12:15:10 +00:00
|
|
|
return rawdb.ReadChainConfig(db, genesisHash), genesisHash
|
2020-10-03 08:07:49 +00:00
|
|
|
}
|