diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 638194206b..c3627724df 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -84,10 +84,7 @@ var ( utils.TxPoolAccountQueueFlag, utils.TxPoolGlobalQueueFlag, utils.TxPoolLifetimeFlag, - - utils.FastSyncFlag, utils.ExitWhenSyncedFlag, - utils.LightModeFlag, utils.SyncModeFlag, utils.GCModeFlag, utils.LightServFlag, @@ -335,12 +332,12 @@ func startNode(ctx *cli.Context, stack *node.Node) { if exitWhenSynced := ctx.GlobalDuration(utils.ExitWhenSyncedFlag.Name); exitWhenSynced >= 0 { go func() { - if ctx.GlobalBool(utils.LightModeFlag.Name) || ctx.GlobalString(utils.SyncModeFlag.Name) == "light" { + if ctx.GlobalString(utils.SyncModeFlag.Name) == "light" { var lightEthereum *les.LightEthereum if err := stack.Service(&lightEthereum); err != nil { utils.Fatalf("LightEthereum service not running: %v", err) } - <-lightEthereum.Downloader().syncedCh + <-lightEthereum.Downloader().SyncedCh log.Info("Synchronisation completed, exitting", "countdown", exitWhenSynced) time.Sleep(exitWhenSynced) stack.Stop() @@ -350,7 +347,7 @@ func startNode(ctx *cli.Context, stack *node.Node) { if err := stack.Service(ðereum); err != nil { utils.Fatalf("Ethereum service not running: %v", err) } - <-ethereum.Downloader().syncedCh + <-ethereum.Downloader().SyncedCh log.Info("Synchronisation completed, exitting", "countdown", exitWhenSynced) time.Sleep(exitWhenSynced) stack.Stop() diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index c28d95ee93..bca8cef381 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -128,7 +128,7 @@ type Downloader struct { bodyWakeCh chan bool // [eth/62] Channel to signal the block body fetcher of new tasks receiptWakeCh chan bool // [eth/63] Channel to signal the receipt fetcher of new tasks headerProcCh chan []*types.Header // [eth/62] Channel to feed the header processor new tasks - syncedCh chan bool + SyncedCh chan bool // for stateFetcher stateSyncStart chan *stateSync @@ -227,7 +227,7 @@ func New(mode SyncMode, stateDb ethdb.Database, mux *event.TypeMux, chain BlockC syncStatsState: stateSyncStats{ processed: rawdb.ReadFastTrieProgress(stateDb), }, - syncedCh: make(chan bool, 1), + SyncedCh: make(chan bool, 1), trackStateReq: make(chan *stateReq), } go dl.qosTuner() @@ -320,7 +320,7 @@ func (d *Downloader) Synchronise(id string, head common.Hash, td *big.Int, mode switch err { case nil: select { - case d.syncedCh <- true: + case d.SyncedCh <- true: default: } case errBusy: diff --git a/les/fetcher.go b/les/fetcher.go index 8834f1b0e3..099934f3a0 100644 --- a/les/fetcher.go +++ b/les/fetcher.go @@ -50,7 +50,7 @@ type lightFetcher struct { lastUpdateStats *updateStatsEntry syncing bool syncDone chan *peer - syncedCh chan bool + SyncedCh chan bool reqMu sync.RWMutex // reqMu protects access to sent header fetch requests requested map[uint64]fetchRequest @@ -117,7 +117,7 @@ func newLightFetcher(pm *ProtocolManager) *lightFetcher { timeoutChn: make(chan uint64), requestChn: make(chan bool, 100), syncDone: make(chan *peer), - syncedCh: make(chan bool, 1), + SyncedCh: make(chan bool, 1), maxConfirmedTd: big.NewInt(0), } pm.peers.notify(f) @@ -448,7 +448,7 @@ func (f *lightFetcher) nextRequest() (*distReq, uint64) { p.Log().Debug("Synchronisation started") f.pm.synchronise(p) f.syncDone <- p - f.syncedCh <- true + f.SyncedCh <- true }() return nil },