cmd, eth, les: Fixed bugs resulting formatting

This commit is contained in:
Lucas Hendren 2018-09-05 23:53:21 -04:00
parent c22c3825c2
commit 87eab8abd1
3 changed files with 9 additions and 12 deletions

View file

@ -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(&ethereum); 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()

View file

@ -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:

View file

@ -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
},