eth: fix some log nitpicks to make them nicer

This commit is contained in:
Péter Szilágyi 2017-03-02 14:56:39 +02:00
parent 59cfdc5302
commit 454cad1a28
No known key found for this signature in database
GPG key ID: E9AE538CEDF8293D
2 changed files with 7 additions and 7 deletions

View file

@ -179,7 +179,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
if err := addMipmapBloomBins(chainDb); err != nil { if err := addMipmapBloomBins(chainDb); err != nil {
return nil, err return nil, err
} }
log.Info("Initializing Ethereum protocol", "versions", ProtocolVersions, "network", config.NetworkId) log.Info("Initialising Ethereum protocol", "versions", ProtocolVersions, "network", config.NetworkId)
if !config.SkipBcVersionCheck { if !config.SkipBcVersionCheck {
bcVersion := core.GetBlockChainVersion(chainDb) bcVersion := core.GetBlockChainVersion(chainDb)
@ -207,7 +207,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
eth.chainConfig = config.ChainConfig eth.chainConfig = config.ChainConfig
log.Info("Initialized chain configuration", "config", eth.chainConfig) log.Info("Initialised chain configuration", "config", eth.chainConfig)
eth.blockchain, err = core.NewBlockChain(chainDb, eth.chainConfig, eth.pow, eth.EventMux(), vm.Config{EnablePreimageRecording: config.EnablePreimageRecording}) eth.blockchain, err = core.NewBlockChain(chainDb, eth.chainConfig, eth.pow, eth.EventMux(), vm.Config{EnablePreimageRecording: config.EnablePreimageRecording})
if err != nil { if err != nil {
@ -464,14 +464,14 @@ func (self *Ethereum) StartAutoDAG() {
return // already started return // already started
} }
go func() { go func() {
log.Info("Pregeneration of ethash DAG on", "dagdir", ethash.DefaultDir) log.Info("Pre-generation of ethash DAG on", "dir", ethash.DefaultDir)
var nextEpoch uint64 var nextEpoch uint64
timer := time.After(0) timer := time.After(0)
self.autodagquit = make(chan bool) self.autodagquit = make(chan bool)
for { for {
select { select {
case <-timer: case <-timer:
log.Info("Checking DAG availability", "dagdir", ethash.DefaultDir) log.Info("Checking DAG availability", "dir", ethash.DefaultDir)
currentBlock := self.BlockChain().CurrentBlock().NumberU64() currentBlock := self.BlockChain().CurrentBlock().NumberU64()
thisEpoch := currentBlock / epochLength thisEpoch := currentBlock / epochLength
if nextEpoch <= thisEpoch { if nextEpoch <= thisEpoch {
@ -485,7 +485,7 @@ func (self *Ethereum) StartAutoDAG() {
nextEpoch = thisEpoch + 1 nextEpoch = thisEpoch + 1
dag, _ := dagFiles(nextEpoch) dag, _ := dagFiles(nextEpoch)
if _, err := os.Stat(dag); os.IsNotExist(err) { if _, err := os.Stat(dag); os.IsNotExist(err) {
log.Info("Pregenerating next DAG", "epoch", nextEpoch, "dag", dag) log.Info("Pre-generating next DAG", "epoch", nextEpoch, "dag", dag)
err := ethash.MakeDAG(nextEpoch*epochLength, "") // "" -> ethash.DefaultDir err := ethash.MakeDAG(nextEpoch*epochLength, "") // "" -> ethash.DefaultDir
if err != nil { if err != nil {
log.Error("Error generating DAG", "epoch", nextEpoch, "dag", dag, "err", err) log.Error("Error generating DAG", "epoch", nextEpoch, "dag", dag, "err", err)
@ -510,7 +510,7 @@ func (self *Ethereum) StopAutoDAG() {
close(self.autodagquit) close(self.autodagquit)
self.autodagquit = nil self.autodagquit = nil
} }
log.Info("Pregeneration of ethash DAG off", "dagdir", ethash.DefaultDir) log.Info("Pre-generation of ethash DAG off", "dir", ethash.DefaultDir)
} }
// dagFiles(epoch) returns the two alternative DAG filenames (not a path) // dagFiles(epoch) returns the two alternative DAG filenames (not a path)

View file

@ -190,7 +190,7 @@ func (p *peer) SendReceiptsRLP(receipts []rlp.RawValue) error {
// RequestHeaders is a wrapper around the header query functions to fetch a // RequestHeaders is a wrapper around the header query functions to fetch a
// single header. It is used solely by the fetcher. // single header. It is used solely by the fetcher.
func (p *peer) RequestOneHeader(hash common.Hash) error { func (p *peer) RequestOneHeader(hash common.Hash) error {
p.Log().Debug("Fetching a single header", "hash", hash) p.Log().Debug("Fetching single header", "hash", hash)
return p2p.Send(p.rw, GetBlockHeadersMsg, &getBlockHeadersData{Origin: hashOrNumber{Hash: hash}, Amount: uint64(1), Skip: uint64(0), Reverse: false}) return p2p.Send(p.rw, GetBlockHeadersMsg, &getBlockHeadersData{Origin: hashOrNumber{Hash: hash}, Amount: uint64(1), Skip: uint64(0), Reverse: false})
} }