mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 02:10:46 +00:00
fix unit tests
This commit is contained in:
parent
d281cfb854
commit
d277d0b444
1 changed files with 14 additions and 12 deletions
|
|
@ -27,6 +27,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/accounts"
|
"github.com/ethereum/go-ethereum/accounts"
|
||||||
"github.com/ethereum/go-ethereum/accounts/keystore"
|
"github.com/ethereum/go-ethereum/accounts/keystore"
|
||||||
"github.com/ethereum/go-ethereum/cmd/utils"
|
"github.com/ethereum/go-ethereum/cmd/utils"
|
||||||
|
"github.com/ethereum/go-ethereum/consensus/XDPoS"
|
||||||
"github.com/ethereum/go-ethereum/console"
|
"github.com/ethereum/go-ethereum/console"
|
||||||
"github.com/ethereum/go-ethereum/core"
|
"github.com/ethereum/go-ethereum/core"
|
||||||
"github.com/ethereum/go-ethereum/eth"
|
"github.com/ethereum/go-ethereum/eth"
|
||||||
|
|
@ -146,7 +147,7 @@ func init() {
|
||||||
// Initialize the CLI app and start XDC
|
// Initialize the CLI app and start XDC
|
||||||
app.Action = XDC
|
app.Action = XDC
|
||||||
app.HideVersion = true // we have a command to print the version
|
app.HideVersion = true // we have a command to print the version
|
||||||
app.Copyright = "Copyright (c) 2018 XDCchain"
|
app.Copyright = "Copyright (c) 2018 Xinfin"
|
||||||
app.Commands = []cli.Command{
|
app.Commands = []cli.Command{
|
||||||
// See chaincmd.go:
|
// See chaincmd.go:
|
||||||
initCommand,
|
initCommand,
|
||||||
|
|
@ -284,15 +285,16 @@ func startNode(ctx *cli.Context, stack *node.Node, cfg XDCConfig) {
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
// Start auxiliary services if enabled
|
// Start auxiliary services if enabled
|
||||||
if cfg.StakeEnable || ctx.GlobalBool(utils.DeveloperFlag.Name) {
|
|
||||||
// Mining only makes sense if a full Ethereum node is running
|
// Mining only makes sense if a full Ethereum node is running
|
||||||
if ctx.GlobalBool(utils.LightModeFlag.Name) || ctx.GlobalString(utils.SyncModeFlag.Name) == "light" {
|
if ctx.GlobalBool(utils.LightModeFlag.Name) || ctx.GlobalString(utils.SyncModeFlag.Name) == "light" {
|
||||||
utils.Fatalf("Light clients do not support staking")
|
utils.Fatalf("Light clients do not support staking")
|
||||||
}
|
}
|
||||||
var ethereum *eth.Ethereum
|
var ethereum *eth.Ethereum
|
||||||
if err := stack.Service(ðereum); err != nil {
|
if err := stack.Service(ðereum); err != nil {
|
||||||
utils.Fatalf("Ethereum service not running: %v", err)
|
utils.Fatalf("Ethereum service not running: %v", err)
|
||||||
}
|
}
|
||||||
|
if _, ok := ethereum.Engine().(*XDPoS.XDPoS); ok {
|
||||||
go func() {
|
go func() {
|
||||||
started := false
|
started := false
|
||||||
ok, err := ethereum.ValidateStaker()
|
ok, err := ethereum.ValidateStaker()
|
||||||
|
|
@ -356,8 +358,8 @@ func startNode(ctx *cli.Context, stack *node.Node, cfg XDCConfig) {
|
||||||
}
|
}
|
||||||
case <-core.M1Ch:
|
case <-core.M1Ch:
|
||||||
err := ethereum.BlockChain().UpdateM1()
|
err := ethereum.BlockChain().UpdateM1()
|
||||||
if(err !=nil){
|
if err != nil {
|
||||||
log.Error("Error when update M1",err)
|
log.Error("Error when update M1", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue