aboutsummaryrefslogtreecommitdiffstats
path: root/light/txpool.go
diff options
context:
space:
mode:
Diffstat (limited to 'light/txpool.go')
-rw-r--r--light/txpool.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/light/txpool.go b/light/txpool.go
index bcdb6123d..365f02d25 100644
--- a/light/txpool.go
+++ b/light/txpool.go
@@ -26,8 +26,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/rlp"
"golang.org/x/net/context"
@@ -321,7 +320,7 @@ func (pool *TxPool) eventLoop() {
func (pool *TxPool) Stop() {
close(pool.quit)
pool.events.Unsubscribe()
- glog.V(logger.Info).Infoln("Transaction pool stopped")
+ log.Info(fmt.Sprint("Transaction pool stopped"))
}
// Stats returns the number of currently pending (locally created) transactions
@@ -417,7 +416,7 @@ func (self *TxPool) add(ctx context.Context, tx *types.Transaction) error {
go self.eventMux.Post(core.TxPreEvent{Tx: tx})
}
- if glog.V(logger.Debug) {
+ log.Debug("", "msg", log.Lazy{Fn: func() string {
var toname string
if to := tx.To(); to != nil {
toname = common.Bytes2Hex(to[:4])
@@ -428,8 +427,8 @@ func (self *TxPool) add(ctx context.Context, tx *types.Transaction) error {
// verified in ValidateTransaction.
f, _ := types.Sender(self.signer, tx)
from := common.Bytes2Hex(f[:4])
- glog.Infof("(t) %x => %s (%v) %x\n", from, toname, tx.Value, hash)
- }
+ return fmt.Sprintf("(t) %x => %s (%v) %x\n", from, toname, tx.Value(), hash)
+ }})
return nil
}
@@ -464,11 +463,11 @@ func (self *TxPool) AddBatch(ctx context.Context, txs []*types.Transaction) {
for _, tx := range txs {
if err := self.add(ctx, tx); err != nil {
- glog.V(logger.Debug).Infoln("tx error:", err)
+ log.Debug(fmt.Sprint("tx error:", err))
} else {
sendTx = append(sendTx, tx)
h := tx.Hash()
- glog.V(logger.Debug).Infof("tx %x\n", h[:4])
+ log.Debug(fmt.Sprintf("tx %x\n", h[:4]))
}
}