Fixed issue | File updated

This commit is contained in:
AnilChinchawale 2019-01-06 08:32:23 +05:30
parent a4e35b0a22
commit 1ce4eba0d6
3 changed files with 8 additions and 32 deletions

View file

@ -74,8 +74,10 @@ SUBCOMMANDS:
func init() { func init() {
cli.AppHelpTemplate = `{{.Name}} {{if .Flags}}[global options] {{end}}command{{if .Flags}} [command options]{{end}} [arguments...] cli.AppHelpTemplate = `{{.Name}} {{if .Flags}}[global options] {{end}}command{{if .Flags}} [command options]{{end}} [arguments...]
VERSION: VERSION:
{{.Version}} {{.Version}}
COMMANDS: COMMANDS:
{{range .Commands}}{{.Name}}{{with .ShortName}}, {{.}}{{end}}{{ "\t" }}{{.Usage}} {{range .Commands}}{{.Name}}{{with .ShortName}}, {{.}}{{end}}{{ "\t" }}{{.Usage}}
{{end}}{{if .Flags}} {{end}}{{if .Flags}}
@ -110,12 +112,6 @@ func NewApp(gitCommit, usage string) *cli.App {
// are the same for all commands. // are the same for all commands.
var ( var (
// XDC flags.
RollbackFlag = cli.StringFlag{
Name: "rollback",
Usage: "Rollback chain at hash",
Value: "",
}
// General settings // General settings
AnnounceTxsFlag = cli.BoolFlag{ AnnounceTxsFlag = cli.BoolFlag{
Name: "announce-txs", Name: "announce-txs",
@ -1091,9 +1087,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
cfg.EnablePreimageRecording = ctx.GlobalBool(VMEnableDebugFlag.Name) cfg.EnablePreimageRecording = ctx.GlobalBool(VMEnableDebugFlag.Name)
} }
if ctx.GlobalIsSet(StoreRewardFlag.Name) { if ctx.GlobalIsSet(StoreRewardFlag.Name) {
common.StoreRewardFolder = filepath.Join(stack.DataDir(), "XDC", "rewards") cfg.StoreRewardFolder = filepath.Join(stack.DataDir(), "XDC", "rewards")
if _, err := os.Stat(common.StoreRewardFolder); os.IsNotExist(err) { if _, err := os.Stat(cfg.StoreRewardFolder); os.IsNotExist(err) {
os.Mkdir(common.StoreRewardFolder, os.ModePerm) os.Mkdir(cfg.StoreRewardFolder, os.ModePerm)
} }
} }
// Override any default configs for hard coded networks. // Override any default configs for hard coded networks.
@ -1260,7 +1256,6 @@ func MakeChain(ctx *cli.Context, stack *node.Node) (chain *core.BlockChain, chai
DatasetsOnDisk: eth.DefaultConfig.Ethash.DatasetsOnDisk, DatasetsOnDisk: eth.DefaultConfig.Ethash.DatasetsOnDisk,
}) })
} }
Fatalf("Only support XDPoS consensus")
} }
if gcmode := ctx.GlobalString(GCModeFlag.Name); gcmode != "full" && gcmode != "archive" { if gcmode := ctx.GlobalString(GCModeFlag.Name); gcmode != "full" && gcmode != "archive" {
Fatalf("--%s must be either 'full' or 'archive'", GCModeFlag.Name) Fatalf("--%s must be either 'full' or 'archive'", GCModeFlag.Name)

View file

@ -1,7 +1,5 @@
package common package common
import "math/big"
const ( const (
RewardMasterPercent = 40 RewardMasterPercent = 40
RewardVoterPercent = 50 RewardVoterPercent = 50
@ -16,14 +14,7 @@ const (
LimitPenaltyEpoch = 4 LimitPenaltyEpoch = 4
BlocksPerYear = uint64(15768000) BlocksPerYear = uint64(15768000)
LimitThresholdNonceInQueue = 10 LimitThresholdNonceInQueue = 10
DefaultMinGasPrice = 2500 MinGasPrice = 2500
MergeSignRange = 15
RangeReturnSigner = 90
) )
var TIP2019Block = big.NewInt(1050000)
var TIPEVMSignerBlock = big.NewInt(2500000)
var IsTestnet bool = false var IsTestnet bool = false
var StoreRewardFolder string
var RollbackHash Hash
var MinGasPrice int64

View file

@ -35,11 +35,6 @@ const (
RandomizeSMC = "0x0000000000000000000000000000000000000090" RandomizeSMC = "0x0000000000000000000000000000000000000090"
FoudationAddr = "0x0000000000000000000000000000000000000068" FoudationAddr = "0x0000000000000000000000000000000000000068"
TeamAddr = "0x0000000000000000000000000000000000000099" TeamAddr = "0x0000000000000000000000000000000000000099"
VoteMethod = "0x6dd7d8ea"
UnvoteMethod = "0x02aa9be2"
ProposeMethod = "0x01267951"
ResignMethod = "0xae6e43f5"
SignMethod = "0xe341eaa4"
) )
var ( var (
@ -50,11 +45,6 @@ var (
// Hash represents the 32 byte Keccak256 hash of arbitrary data. // Hash represents the 32 byte Keccak256 hash of arbitrary data.
type Hash [HashLength]byte type Hash [HashLength]byte
type Vote struct {
Masternode Address
Voter Address
}
func BytesToHash(b []byte) Hash { func BytesToHash(b []byte) Hash {
var h Hash var h Hash
h.SetBytes(b) h.SetBytes(b)