aboutsummaryrefslogtreecommitdiffstats
path: root/eth/sync.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-03-02 21:06:16 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2017-03-02 21:06:16 +0800
commit9184249b393e4e332ae6a2f5d774880a88a9bfd6 (patch)
tree7788ce54cb04d1af4fe03ab3c2447354bcaac3cc /eth/sync.go
parent82e7c1d1241737fd0ae9b25e0f20857b8597b148 (diff)
downloadgo-tangerine-9184249b393e4e332ae6a2f5d774880a88a9bfd6.tar
go-tangerine-9184249b393e4e332ae6a2f5d774880a88a9bfd6.tar.gz
go-tangerine-9184249b393e4e332ae6a2f5d774880a88a9bfd6.tar.bz2
go-tangerine-9184249b393e4e332ae6a2f5d774880a88a9bfd6.tar.lz
go-tangerine-9184249b393e4e332ae6a2f5d774880a88a9bfd6.tar.xz
go-tangerine-9184249b393e4e332ae6a2f5d774880a88a9bfd6.tar.zst
go-tangerine-9184249b393e4e332ae6a2f5d774880a88a9bfd6.zip
Logger updates 3 (#3730)
* accounts, cmd, eth, ethdb: port logs over to new system * ethdb: drop concept of cache distribution between dbs * eth: fix some log nitpicks to make them nicer
Diffstat (limited to 'eth/sync.go')
-rw-r--r--eth/sync.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/eth/sync.go b/eth/sync.go
index 1075578b9..6e2c7c432 100644
--- a/eth/sync.go
+++ b/eth/sync.go
@@ -17,7 +17,6 @@
package eth
import (
- "fmt"
"math/rand"
"sync/atomic"
"time"
@@ -87,7 +86,7 @@ func (pm *ProtocolManager) txsyncLoop() {
delete(pending, s.p.ID())
}
// Send the pack in the background.
- log.Trace(fmt.Sprintf("%v: sending %d transactions (%v)", s.p.Peer, len(pack.txs), size))
+ s.p.Log().Trace("Sending batch of transactions", "count", len(pack.txs), "bytes", size)
sending = true
go func() { done <- pack.p.SendTransactions(pack.txs) }()
}
@@ -117,7 +116,7 @@ func (pm *ProtocolManager) txsyncLoop() {
sending = false
// Stop tracking peers that cause send failures.
if err != nil {
- log.Debug(fmt.Sprintf("%v: tx send failed: %v", pack.p.Peer, err))
+ pack.p.Log().Debug("Transaction send failed", "err", err)
delete(pending, pack.p.ID())
}
// Schedule the next send.
@@ -187,7 +186,7 @@ func (pm *ProtocolManager) synchronise(peer *peer) {
if atomic.LoadUint32(&pm.fastSync) == 1 {
// Disable fast sync if we indeed have something in our chain
if pm.blockchain.CurrentBlock().NumberU64() > 0 {
- log.Info(fmt.Sprintf("fast sync complete, auto disabling"))
+ log.Info("Fast sync complete, auto disabling")
atomic.StoreUint32(&pm.fastSync, 0)
}
}