p2p, eth: improve logs (#2123)
* p2p/discover: only show discovery status for bootnodes * eth/downloader: uplevel expired request log
This commit is contained in:
parent
b2de32fb16
commit
7b22894146
@ -645,7 +645,7 @@ func (q *queue) expire(peer string, pendPool map[string]*fetchRequest, taskQueue
|
||||
// as there's no order of events that should lead to such expirations.
|
||||
req := pendPool[peer]
|
||||
if req == nil {
|
||||
log.Error("Expired request does not exist", "peer", peer)
|
||||
log.Trace("Expired request does not exist", "peer", peer)
|
||||
return 0
|
||||
}
|
||||
delete(pendPool, peer)
|
||||
|
@ -151,7 +151,7 @@ func ListenV4(c UDPConn, ln *enode.LocalNode, cfg Config) (*UDPv4, error) {
|
||||
go tab.loop()
|
||||
|
||||
t.wg.Add(2)
|
||||
go t.loop()
|
||||
go t.loop(cfg.IsBootnode)
|
||||
go t.readLoop(cfg.Unhandled)
|
||||
return t, nil
|
||||
}
|
||||
@ -405,7 +405,7 @@ func (t *UDPv4) handleReply(from enode.ID, fromIP net.IP, req v4wire.Packet) boo
|
||||
|
||||
// loop runs in its own goroutine. it keeps track of
|
||||
// the refresh timer and the pending reply queue.
|
||||
func (t *UDPv4) loop() {
|
||||
func (t *UDPv4) loop(isBootNode bool) {
|
||||
defer t.wg.Done()
|
||||
|
||||
var (
|
||||
@ -442,7 +442,9 @@ func (t *UDPv4) loop() {
|
||||
}
|
||||
|
||||
logStatistic := func() {
|
||||
t.log.Info("Current status", "table_size", t.tab.len(), "pending_size", plist.Len(), "db_size", t.db.Size())
|
||||
if isBootNode {
|
||||
t.log.Info("Discovery status", "table_size", t.tab.len(), "pending_size", plist.Len(), "db_size", t.db.Size())
|
||||
}
|
||||
}
|
||||
|
||||
for {
|
||||
|
Loading…
Reference in New Issue
Block a user