aboutsummaryrefslogtreecommitdiffstats
path: root/light/lightchain.go
diff options
context:
space:
mode:
Diffstat (limited to 'light/lightchain.go')
-rw-r--r--light/lightchain.go34
1 files changed, 17 insertions, 17 deletions
diff --git a/light/lightchain.go b/light/lightchain.go
index 0d28ad2f4..1f0fb9c34 100644
--- a/light/lightchain.go
+++ b/light/lightchain.go
@@ -17,6 +17,7 @@
package light
import (
+ "fmt"
"math/big"
"sync"
"sync/atomic"
@@ -27,8 +28,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
- "github.com/ethereum/go-ethereum/logger"
- "github.com/ethereum/go-ethereum/logger/glog"
+ "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/pow"
"github.com/ethereum/go-ethereum/rlp"
@@ -101,7 +101,7 @@ func NewLightChain(odr OdrBackend, config *params.ChainConfig, pow pow.PoW, mux
if err != nil {
return nil, err
}
- glog.V(logger.Info).Infoln("WARNING: Wrote default ethereum genesis block")
+ log.Info(fmt.Sprint("WARNING: Wrote default ethereum genesis block"))
}
if bc.genesisBlock.Hash() == (common.Hash{212, 229, 103, 64, 248, 118, 174, 248, 192, 16, 184, 106, 64, 213, 245, 103, 69, 161, 24, 208, 144, 106, 52, 230, 154, 236, 140, 13, 177, 203, 143, 163}) {
@@ -117,7 +117,7 @@ func NewLightChain(odr OdrBackend, config *params.ChainConfig, pow pow.PoW, mux
Root: common.HexToHash("c035076523faf514038f619715de404a65398c51899b5dccca9c05b00bc79315"),
})
}
- glog.V(logger.Info).Infoln("Added trusted CHT for mainnet")
+ log.Info(fmt.Sprint("Added trusted CHT for mainnet"))
} else {
if bc.genesisBlock.Hash() == (common.Hash{12, 215, 134, 162, 66, 93, 22, 241, 82, 198, 88, 49, 108, 66, 62, 108, 225, 24, 30, 21, 195, 41, 88, 38, 215, 201, 144, 76, 186, 156, 227, 3}) {
// add trusted CHT for testnet
@@ -125,7 +125,7 @@ func NewLightChain(odr OdrBackend, config *params.ChainConfig, pow pow.PoW, mux
Number: 452,
Root: common.HexToHash("511da2c88e32b14cf4a4e62f7fcbb297139faebc260a4ab5eb43cce6edcba324"),
})
- glog.V(logger.Info).Infoln("Added trusted CHT for testnet")
+ log.Info(fmt.Sprint("Added trusted CHT for testnet"))
} else {
DeleteTrustedCht(bc.chainDb)
}
@@ -137,9 +137,9 @@ func NewLightChain(odr OdrBackend, config *params.ChainConfig, pow pow.PoW, mux
// Check the current state of the block hashes and make sure that we do not have any of the bad blocks in our chain
for hash := range core.BadHashes {
if header := bc.GetHeaderByHash(hash); header != nil {
- glog.V(logger.Error).Infof("Found bad hash, rewinding chain to block #%d [%x…]", header.Number, header.ParentHash[:4])
+ log.Error(fmt.Sprintf("Found bad hash, rewinding chain to block #%d [%x…]", header.Number, header.ParentHash[:4]))
bc.SetHead(header.Number.Uint64() - 1)
- glog.V(logger.Error).Infoln("Chain rewind was successful, resuming normal operation")
+ log.Error(fmt.Sprint("Chain rewind was successful, resuming normal operation"))
}
}
return bc, nil
@@ -169,7 +169,7 @@ func (self *LightChain) loadLastState() error {
// Issue a status log and return
header := self.hc.CurrentHeader()
headerTd := self.GetTd(header.Hash(), header.Number.Uint64())
- glog.V(logger.Info).Infof("Last header: #%d [%x…] TD=%v", self.hc.CurrentHeader().Number, self.hc.CurrentHeader().Hash().Bytes()[:4], headerTd)
+ log.Info(fmt.Sprintf("Last header: #%d [%x…] TD=%v", self.hc.CurrentHeader().Number, self.hc.CurrentHeader().Hash().Bytes()[:4], headerTd))
return nil
}
@@ -246,10 +246,10 @@ func (bc *LightChain) ResetWithGenesisBlock(genesis *types.Block) {
// Prepare the genesis block and reinitialise the chain
if err := core.WriteTd(bc.chainDb, genesis.Hash(), genesis.NumberU64(), genesis.Difficulty()); err != nil {
- glog.Fatalf("failed to write genesis block TD: %v", err)
+ log.Crit(fmt.Sprintf("failed to write genesis block TD: %v", err))
}
if err := core.WriteBlock(bc.chainDb, genesis); err != nil {
- glog.Fatalf("failed to write genesis block: %v", err)
+ log.Crit(fmt.Sprintf("failed to write genesis block: %v", err))
}
bc.genesisBlock = genesis
bc.hc.SetGenesis(bc.genesisBlock.Header())
@@ -346,7 +346,7 @@ func (bc *LightChain) Stop() {
bc.wg.Wait()
- glog.V(logger.Info).Infoln("Chain manager stopped")
+ log.Info(fmt.Sprint("Chain manager stopped"))
}
// Rollback is designed to remove a chain of links from the database that aren't
@@ -406,15 +406,15 @@ func (self *LightChain) InsertHeaderChain(chain []*types.Header, checkFreq int)
switch status {
case core.CanonStatTy:
- if glog.V(logger.Debug) {
- glog.Infof("[%v] inserted header #%d (%x...).\n", time.Now().UnixNano(), header.Number, header.Hash().Bytes()[0:4])
- }
+ log.Debug("", "msg", log.Lazy{Fn: func() string {
+ return fmt.Sprintf("[%v] inserted header #%d (%x...).\n", time.Now().UnixNano(), header.Number, header.Hash().Bytes()[0:4])
+ }})
events = append(events, core.ChainEvent{Block: types.NewBlockWithHeader(header), Hash: header.Hash()})
case core.SideStatTy:
- if glog.V(logger.Detail) {
- glog.Infof("inserted forked header #%d (TD=%v) (%x...).\n", header.Number, header.Difficulty, header.Hash().Bytes()[0:4])
- }
+ log.Trace("", "msg", log.Lazy{Fn: func() string {
+ return fmt.Sprintf("inserted forked header #%d (TD=%v) (%x...).\n", header.Number, header.Difficulty, header.Hash().Bytes()[0:4])
+ }})
events = append(events, core.ChainSideEvent{Block: types.NewBlockWithHeader(header)})
case core.SplitStatTy:
mitgraph'>* Remove useless WRKSRC definitions.mat2016-05-251-2/+0 * x11-toolkits/qt5-widgets: fix scaling / cropping for full-screen applicationspi2016-05-243-1/+53 * Remove NLS, DOCS, EXAMPLES and IPV6 from OPTIONS_DEFAULT, they are enabled by...amdmi32016-05-241-1/+1 * Convert tab after WWW: in pkg-descrs to single space as per PHBamdmi32016-05-249-9/+9 * During the exp-run in bug 208158, it was found that x11-toolkits/wxgtk30dim2016-05-241-0/+10 * Fix pango install deinstall script that are no longer needed since 1.38bapt2016-05-232-3/+1 * - Fix trailing whitespace in pkg-messagesamdmi32016-05-191-1/+1 * - Fix trailing whitespace in pkg-descrs, categories [p-x]*amdmi32016-05-1921-51/+51 * Update scite and scintilla to 3.6.5.madpilot2016-05-142-3/+4 * Update to version 2.2.13pawel2016-05-113-4/+4 * graphics/py-opengl{-accelerate}: 3.0.1 -> 3.1.0, change to PyPI namingpi2016-05-102-5/+5 * Change Ada Framework foundation from gcc5-aux to gcc6-auxmarino2016-04-303-3/+3 * Convert USES=gem:autoplist to USES=gem since autoplist is defaultswills2016-04-289-9/+9 * create USES=gem and update rubygem- ports to use itswills2016-04-289-18/+9 * - Remove outdated PERL_LEVEL checksunpoet2016-04-231-8/+1 * - Add LICENSE_FILEsunpoet2016-04-231-0/+1 * - Add LICENSE_FILEsunpoet2016-04-231-0/+1 * Convert more ports to USES=(tcl|tk):teagahr2016-04-2215-142/+72 * many ports: mark broken on powerpc64swills2016-04-221-0/+2 * Update to 0.2.6madpilot2016-04-203-10/+10 * New port: x11-toolkits/p5-Gtk3pi2016-04-185-0/+38 * Consistently prefer ${CONFIGURE_CMD} over ./${CONFIGURE_SCRIPT}jbeich2016-04-131-1/+1 * CentOS ports: for c6_64, install 32bit libraries alongsideswills2016-04-1313-9/+162 * - Update to 3.0.8sunpoet2016-04-122-3/+3 * - Update to 3.0.8sunpoet2016-04-123-31/+3 * - Update to 3.0.8sunpoet2016-04-122-4/+3 * - Update to 3.0.8sunpoet2016-04-122-4/+3 * - Update to 3.0.8sunpoet2016-04-122-4/+3 * - Update to 3.0.8sunpoet2016-04-122-4/+3 * - Update to 3.0.8sunpoet2016-04-122-4/+3 * - Update to 3.0.8sunpoet2016-04-122-4/+3 * - Update to 3.0.8sunpoet2016-04-122-4/+3 * x11-toolkits/p5-Pango: update to 1.227swills2016-04-102-4/+3 * x11-toolkits/p5-Gtk2: update to 1.2498swills2016-04-102-3/+3 * x11-toolkits/bwidget: update to 1.9.10gahr2016-04-082-7/+7 * Remove ${PORTSDIR}/ from dependencies, categories v, w, x, y, and z.mat2016-04-01157-421/+421 * Fixup some whitespace at the beginning of lines problems.mat2016-04-015-5/+5 * - Update to 0.5.0sunpoet2016-04-011-0/+1 * Correct MASTER_SITE URL.cy2016-03-291-1/+1 * Welcome the new x11-tookits/Xmt port.cy2016-03-289-0/+422 * - Update security/gnutls to 3.4.10.tijl2016-03-275-4/+5 * - Update to 3.6.4wen2016-03-273-5/+5 * Update to 1.6.51.mat2016-03-234-13/+27 * Update to 1.46. Prima can now leverage pkg-config, so switch toadamw2016-03-214-24/+5 * Update 2.3.4 --> 2.3.5.cy2016-03-183-8/+18 * - Add LICENSE_FILEamdmi32016-03-161-1/+2 * Combine print/cups-base, print/cups-client and print/cups-image intotijl2016-03-115-9/+10 * x11-toolkits/attica: Change the location where we install its headers.rakuco2016-03-092-43/+57 * Switch to an out-of-source CMake build.rakuco2016-03-091-1/+1 * Update to 1.1.10.mat2016-03-0811-77/+75 * Always set the DEFAULT github DISTFILE with .tar.gz for EXTRACT_SUFX.mat2016-03-081-2/+2 * Update vte3 to 0.42.4.kwm2016-03-043-4/+4 * Update gtk30 to 3.18.8.kwm2016-03-042-4/+4 * Add GStreamer1 gstsink plugin.kwm2016-03-042-0/+14 * x11-toolkits/tk86: switch to OPTIONS helpersgahr2016-03-012-400/+383 * lang/tcl86, x11-toolkits/tk86: update to 8.6.5gahr2016-03-013-5/+4 * x11-toolkits/py-kivy: update to 1.9.1dbn2016-02-258-679/+1411 * lang/tcl85, x11-toolkits/tk85: update to 8.5.19gahr2016-02-164-418/+387 * - Clarify LICENSEamdmi32016-02-151-11/+13 * - Add LICENSEamdmi32016-02-152-15/+16 * - Switch to USES=localbaseamdmi32016-02-151-4/+4 * - Switch to options helpersamdmi32016-02-151-1/+1 * The FreeBSD GNOME team proudly presents GNOME 3.18 for FreeBSD.kwm2016-02-15