mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 19:50:36 +00:00
Only apply overrides to stored config of a private chain (#4521)
This commit is contained in:
parent
1c4584b438
commit
70bd93c5c3
@ -271,10 +271,17 @@ func WriteGenesisBlock(db kv.RwTx, genesis *Genesis, overrideMergeNetsplitBlock,
|
|||||||
}
|
}
|
||||||
return newCfg, storedBlock, nil
|
return newCfg, storedBlock, nil
|
||||||
}
|
}
|
||||||
// Special case: don't change the existing config of an unknown chain if no new
|
// Special case: don't change the existing config of a private chain if no new
|
||||||
// config is supplied. This is useful, for example, to preserve DB config created by erigon init.
|
// config is supplied. This is useful, for example, to preserve DB config created by erigon init.
|
||||||
if genesis == nil && params.ChainConfigByGenesisHash(storedHash) == nil && overrideMergeNetsplitBlock == nil && overrideTerminalTotalDifficulty == nil {
|
// In that case, only apply the overrides.
|
||||||
return storedCfg, storedBlock, nil
|
if genesis == nil && params.ChainConfigByGenesisHash(storedHash) == nil {
|
||||||
|
newCfg = storedCfg
|
||||||
|
if overrideMergeNetsplitBlock != nil {
|
||||||
|
newCfg.MergeNetsplitBlock = overrideMergeNetsplitBlock
|
||||||
|
}
|
||||||
|
if overrideTerminalTotalDifficulty != nil {
|
||||||
|
newCfg.TerminalTotalDifficulty = overrideTerminalTotalDifficulty
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Check config compatibility and write the config. Compatibility errors
|
// Check config compatibility and write the config. Compatibility errors
|
||||||
// are returned to the caller unless we're already at block zero.
|
// are returned to the caller unless we're already at block zero.
|
||||||
|
Loading…
Reference in New Issue
Block a user