mirror of https://github.com/poanetwork/quorum.git
changes to set immutability threshold before freezer db is opened
This commit is contained in:
parent
c215989c10
commit
0fd13d18ef
|
@ -1640,9 +1640,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
|
|||
}
|
||||
|
||||
// set immutability threshold in config
|
||||
if ctx.GlobalIsSet(QuorumImmutabilityThreshold.Name) {
|
||||
cfg.QuorumImmutabilityThreshold = ctx.GlobalInt(QuorumImmutabilityThreshold.Name)
|
||||
}
|
||||
params.SetQuorumImmutabilityThreshold(ctx.GlobalInt(QuorumImmutabilityThreshold.Name))
|
||||
|
||||
// Override any default configs for hard coded networks.
|
||||
switch {
|
||||
|
|
|
@ -150,9 +150,6 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
|||
if (chainConfig.ChainID != nil && chainConfig.ChainID.Int64() == 1) || config.NetworkId == 1 {
|
||||
return nil, errors.New("Cannot have chain id or network id as 1.")
|
||||
}
|
||||
|
||||
// set the immutability threshold value in line with value passed
|
||||
params.SetQuorumImmutabilityThreshold(config.QuorumImmutabilityThreshold)
|
||||
}
|
||||
|
||||
if !rawdb.GetIsQuorumEIP155Activated(chainDb) && chainConfig.ChainID != nil {
|
||||
|
|
|
@ -166,7 +166,4 @@ type Config struct {
|
|||
|
||||
// Istanbul block override (TODO: remove after the fork)
|
||||
OverrideIstanbul *big.Int
|
||||
|
||||
// Freezer db immutability threshold
|
||||
QuorumImmutabilityThreshold int
|
||||
}
|
||||
|
|
|
@ -62,21 +62,20 @@ const (
|
|||
|
||||
// //Quorum
|
||||
var quorumImmutabilityThreshold int
|
||||
var isQuorum = false
|
||||
|
||||
// returns the immutability threshold set for the network
|
||||
func GetImmutabilityThreshold() int {
|
||||
if isQuorum {
|
||||
|
||||
if quorumImmutabilityThreshold > 0 {
|
||||
return quorumImmutabilityThreshold
|
||||
}
|
||||
|
||||
return ImmutabilityThreshold
|
||||
}
|
||||
|
||||
// sets the immutability threshold and isQuorum to passed values
|
||||
func SetQuorumImmutabilityThreshold(immutabilityThreshold int) {
|
||||
quorumImmutabilityThreshold = immutabilityThreshold
|
||||
isQuorum = true
|
||||
}
|
||||
|
||||
// /Quorum
|
||||
|
|
Loading…
Reference in New Issue