diff --git a/eth/backend.go b/eth/backend.go index 3eb130b71d..f7bc11a0fd 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -340,7 +340,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { return err } - if !eth.handler.inited { + if eth.handler.peers.closed { eth.lock.Lock() eth.timeLastBlock = time.Now().Unix() eth.lock.Unlock() @@ -374,11 +374,6 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { for { time.Sleep(100 * time.Millisecond) eth.lock.Lock() - if eth.handler.inited && eth.handler.peers.closed { - log.Info("Networking stopped, return without starting peering...") - eth.lock.Unlock() - return - } // ensure 5 seconds has passed between blocks before we start peering so we are sure sync has finished if time.Now().Unix()-eth.timeLastBlock >= 5 { log.Info("Networking and peering start...") diff --git a/eth/handler.go b/eth/handler.go index 93ce541949..5960fff23f 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -120,8 +120,6 @@ type handler struct { // channels for fetcher, syncer, txsyncLoop quitSync chan struct{} - // SYSCOIN - inited bool wg sync.WaitGroup handlerStartCh chan struct{} @@ -196,8 +194,6 @@ func newHandler(config *handlerConfig) (*handler, error) { addTxs := func(txs []*types.Transaction) []error { return h.txpool.Add(txs, false, false) } - // SYSCOIN - h.inited = false h.txFetcher = fetcher.NewTxFetcher(h.txpool.Has, addTxs, fetchTx, h.removePeer) return h, nil } @@ -433,8 +429,6 @@ func (h *handler) Start(maxPeers int) { h.txsCh = make(chan core.NewTxsEvent, txChanSize) h.txsSub = h.txpool.SubscribeTransactions(h.txsCh, false) go h.txBroadcastLoop() - // SYSCOIN - h.inited = true // start sync handlers h.txFetcher.Start() @@ -444,10 +438,6 @@ func (h *handler) Start(maxPeers int) { } func (h *handler) Stop() { - // SYSCOIN - if !h.inited { - return - } h.txsSub.Unsubscribe() // quits txBroadcastLoop h.txFetcher.Stop() h.downloader.Terminate()