From ece14048a5883ffcc5437d8f9f33d27d145c3551 Mon Sep 17 00:00:00 2001 From: parmarrushabh Date: Sat, 17 Nov 2018 17:10:09 +0530 Subject: [PATCH] fixed only three MNs making block when --XDC testnet flag enable --- cmd/XDC/config.go | 5 +++++ cmd/XDC/main.go | 1 + cmd/utils/flags.go | 4 ++++ common/constants.go | 4 +++- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cmd/XDC/config.go b/cmd/XDC/config.go index ff09e42a0b..ed1a993341 100644 --- a/cmd/XDC/config.go +++ b/cmd/XDC/config.go @@ -36,6 +36,7 @@ import ( "github.com/ethereum/go-ethereum/params" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" "github.com/naoina/toml" + "github.com/ethereum/go-ethereum/common" ) var ( @@ -151,6 +152,10 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, XDCConfig) { ctx.Set(utils.NATFlag.Name, cfg.NAT) } + // Check testnet is enable. + if ctx.GlobalBool(utils.XDCTestnetFlag.Name) { + common.IsTestnet = true + } // read passwords from enviroment passwords := []string{} for _, env := range cfg.Account.Passwords { diff --git a/cmd/XDC/main.go b/cmd/XDC/main.go index de703cc83b..66043a7f82 100644 --- a/cmd/XDC/main.go +++ b/cmd/XDC/main.go @@ -109,6 +109,7 @@ var ( //utils.TestnetFlag, //utils.RinkebyFlag, //utils.VMEnableDebugFlag, + utils.XDCTestnetFlag, utils.NetworkIdFlag, utils.RPCCORSDomainFlag, utils.RPCVirtualHostsFlag, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 2f69b8da35..6051d1c179 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -137,6 +137,10 @@ var ( Name: "testnet", Usage: "Ropsten network: pre-configured proof-of-work test network", } + XDCTestnetFlag = cli.BoolFlag{ + Name: "XDC-testnet", + Usage: "XDC test network", + } RinkebyFlag = cli.BoolFlag{ Name: "rinkeby", Usage: "Rinkeby network: pre-configured proof-of-authority test network", diff --git a/common/constants.go b/common/constants.go index ef6593cfe4..5298dc9da9 100644 --- a/common/constants.go +++ b/common/constants.go @@ -15,4 +15,6 @@ const ( BlocksPerYear = uint64(15768000) LimitThresholdNonceInQueue = 10 MinGasPrice = 2500 -) \ No newline at end of file +) + +var IsTestnet bool = false \ No newline at end of file