Co-authored-by: yihuang <huang@crypto.com> Co-authored-by: marbar3778 <marbar3778@yahoo.com>
This commit is contained in:
co-authored by
yihuang
marbar3778
parent
9c6c648436
commit
d8957530a5
+6
-2
@@ -475,12 +475,16 @@ func DefaultBaseappOptions(appOpts types.AppOptions) []func(*baseapp.BaseApp) {
|
||||
chainID := cast.ToString(appOpts.Get(flags.FlagChainID))
|
||||
if chainID == "" {
|
||||
// fallback to genesis chain-id
|
||||
appGenesis, err := genutiltypes.AppGenesisFromFile(filepath.Join(homeDir, "config", "genesis.json"))
|
||||
reader, err := os.Open(filepath.Join(homeDir, "config", "genesis.json"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer reader.Close()
|
||||
|
||||
chainID = appGenesis.ChainID
|
||||
chainID, err = genutiltypes.ParseChainIDFromGenesis(reader)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("failed to parse chain-id from genesis file: %w", err))
|
||||
}
|
||||
}
|
||||
|
||||
snapshotStore, err := GetSnapshotStore(appOpts)
|
||||
|
||||
Reference in New Issue
Block a user