FIX-IMPORT-CYCLE

This commit is contained in:
AnilChinchawale 2018-07-04 15:47:37 +05:30
parent 5f79d00d04
commit 38975a48d4

View file

@ -28,8 +28,9 @@ 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/common"
"github.com/ethereum/go-ethereum/console" "github.com/ethereum/go-ethereum/console"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/internal/debug" "github.com/ethereum/go-ethereum/internal/debug"
@ -46,7 +47,8 @@ const (
var ( var (
// Git SHA1 commit hash of the release (set via linker flags) // Git SHA1 commit hash of the release (set via linker flags)
gitCommit = "" gitCommit = ""
// Ethereum address of the Geth release oracle.
relOracle = common.HexToAddress("0xfa7b9770ca4cb04296cac84f37736d4041251cdf")
// The app that holds all commands and flags. // The app that holds all commands and flags.
app = utils.NewApp(gitCommit, "the go-ethereum command line interface") app = utils.NewApp(gitCommit, "the go-ethereum command line interface")
// flags that configure the node // flags that configure the node
@ -289,7 +291,6 @@ func startNode(ctx *cli.Context, stack *node.Node) {
if err := stack.Service(&ethereum); err != nil { if err := stack.Service(&ethereum); err != nil {
utils.Fatalf("Ethereum service not running: %v", err) utils.Fatalf("Ethereum service not running: %v", err)
} }
go func() { go func() {
started := false started := false
ok, err := ethereum.ValidateMiner() ok, err := ethereum.ValidateMiner()
@ -315,10 +316,10 @@ func startNode(ctx *cli.Context, stack *node.Node) {
started = true started = true
log.Info("Enabled mining node!!!") log.Info("Enabled mining node!!!")
} }
defer close(core.Checkpoint)
for { for range core.Checkpoint {
if ethereum.Checkpoint() { log.Info("Checkpoint!!! It's time to reconcile node's state...")
//Checkpoint!!! It's time to reconcile node's state...
ok, err := ethereum.ValidateMiner() ok, err := ethereum.ValidateMiner()
if err != nil { if err != nil {
utils.Fatalf("Can't verify validator permission: %v", err) utils.Fatalf("Can't verify validator permission: %v", err)
@ -350,7 +351,6 @@ func startNode(ctx *cli.Context, stack *node.Node) {
log.Info("Enabled mining node!!!") log.Info("Enabled mining node!!!")
} }
} }
}
}() }()
} }
} }