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