mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
cmd, eth, les: Performed gofmt to update formatting
This commit is contained in:
parent
6d1305bdd9
commit
c22c3825c2
4 changed files with 24 additions and 25 deletions
|
|
@ -85,7 +85,7 @@ var (
|
||||||
utils.TxPoolGlobalQueueFlag,
|
utils.TxPoolGlobalQueueFlag,
|
||||||
utils.TxPoolLifetimeFlag,
|
utils.TxPoolLifetimeFlag,
|
||||||
|
|
||||||
utils.FastSyncFlag,
|
utils.FastSyncFlag,
|
||||||
utils.ExitWhenSyncedFlag,
|
utils.ExitWhenSyncedFlag,
|
||||||
utils.LightModeFlag,
|
utils.LightModeFlag,
|
||||||
utils.SyncModeFlag,
|
utils.SyncModeFlag,
|
||||||
|
|
@ -335,27 +335,26 @@ func startNode(ctx *cli.Context, stack *node.Node) {
|
||||||
|
|
||||||
if exitWhenSynced := ctx.GlobalDuration(utils.ExitWhenSyncedFlag.Name); exitWhenSynced >= 0 {
|
if exitWhenSynced := ctx.GlobalDuration(utils.ExitWhenSyncedFlag.Name); exitWhenSynced >= 0 {
|
||||||
go func() {
|
go func() {
|
||||||
if ctx.GlobalBool(utils.LightModeFlag.Name) || ctx.GlobalString(utils.SyncModeFlag.Name) == "light" {
|
if ctx.GlobalBool(utils.LightModeFlag.Name) || ctx.GlobalString(utils.SyncModeFlag.Name) == "light" {
|
||||||
var lightEthereum *les.LightEthereum
|
var lightEthereum *les.LightEthereum
|
||||||
if err := stack.Service(&lightEthereum); err != nil {
|
if err := stack.Service(&lightEthereum); err != nil {
|
||||||
utils.Fatalf("LightEthereum service not running: %v", err)
|
utils.Fatalf("LightEthereum service not running: %v", err)
|
||||||
}
|
}
|
||||||
<-lightEthereum.Downloader().syncedCh
|
<-lightEthereum.Downloader().syncedCh
|
||||||
log.Info("Synchronisation completed, exitting", "countdown", exitWhenSynced)
|
log.Info("Synchronisation completed, exitting", "countdown", exitWhenSynced)
|
||||||
time.Sleep(exitWhenSynced)
|
time.Sleep(exitWhenSynced)
|
||||||
stack.Stop()
|
stack.Stop()
|
||||||
|
|
||||||
|
} else {
|
||||||
} else {
|
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)
|
}
|
||||||
}
|
<-ethereum.Downloader().syncedCh
|
||||||
<-ethereum.Downloader().syncedCh
|
log.Info("Synchronisation completed, exitting", "countdown", exitWhenSynced)
|
||||||
log.Info("Synchronisation completed, exitting", "countdown", exitWhenSynced)
|
time.Sleep(exitWhenSynced)
|
||||||
time.Sleep(exitWhenSynced)
|
stack.Stop()
|
||||||
stack.Stop()
|
}
|
||||||
}
|
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ var (
|
||||||
Value: DirectoryString{homeDir()},
|
Value: DirectoryString{homeDir()},
|
||||||
}
|
}
|
||||||
ExitWhenSyncedFlag = cli.DurationFlag{
|
ExitWhenSyncedFlag = cli.DurationFlag{
|
||||||
Name: "exitwhensynced",
|
Name: "exitwhensynced",
|
||||||
Usage: "Exists syncing by given time (default 0) after block synchronisation",
|
Usage: "Exists syncing by given time (default 0) after block synchronisation",
|
||||||
Value: -1,
|
Value: -1,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -227,7 +227,7 @@ func New(mode SyncMode, stateDb ethdb.Database, mux *event.TypeMux, chain BlockC
|
||||||
syncStatsState: stateSyncStats{
|
syncStatsState: stateSyncStats{
|
||||||
processed: rawdb.ReadFastTrieProgress(stateDb),
|
processed: rawdb.ReadFastTrieProgress(stateDb),
|
||||||
},
|
},
|
||||||
syncedCh: make(chan bool, 1),
|
syncedCh: make(chan bool, 1),
|
||||||
trackStateReq: make(chan *stateReq),
|
trackStateReq: make(chan *stateReq),
|
||||||
}
|
}
|
||||||
go dl.qosTuner()
|
go dl.qosTuner()
|
||||||
|
|
@ -321,7 +321,7 @@ func (d *Downloader) Synchronise(id string, head common.Hash, td *big.Int, mode
|
||||||
case nil:
|
case nil:
|
||||||
select {
|
select {
|
||||||
case d.syncedCh <- true:
|
case d.syncedCh <- true:
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
case errBusy:
|
case errBusy:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ type lightFetcher struct {
|
||||||
syncing bool
|
syncing bool
|
||||||
syncDone chan *peer
|
syncDone chan *peer
|
||||||
syncedCh chan bool
|
syncedCh chan bool
|
||||||
|
|
||||||
reqMu sync.RWMutex // reqMu protects access to sent header fetch requests
|
reqMu sync.RWMutex // reqMu protects access to sent header fetch requests
|
||||||
requested map[uint64]fetchRequest
|
requested map[uint64]fetchRequest
|
||||||
deliverChn chan fetchResponse
|
deliverChn chan fetchResponse
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue