diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 72f7ec694..451a9d4f4 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -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 { diff --git a/eth/backend.go b/eth/backend.go index 33a96ae0a..c8424a547 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -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 { diff --git a/eth/config.go b/eth/config.go index 1fd34297b..14bc7a3bb 100644 --- a/eth/config.go +++ b/eth/config.go @@ -166,7 +166,4 @@ type Config struct { // Istanbul block override (TODO: remove after the fork) OverrideIstanbul *big.Int - - // Freezer db immutability threshold - QuorumImmutabilityThreshold int } diff --git a/params/network_params.go b/params/network_params.go index f36e0124e..0d1ee2d58 100644 --- a/params/network_params.go +++ b/params/network_params.go @@ -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