diff options
Diffstat (limited to 'p2p/discover/database.go')
-rw-r--r-- | p2p/discover/database.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/p2p/discover/database.go b/p2p/discover/database.go index a8b32d31e..7206a63c6 100644 --- a/p2p/discover/database.go +++ b/p2p/discover/database.go @@ -23,7 +23,6 @@ import ( "bytes" "crypto/rand" "encoding/binary" - "fmt" "os" "sync" "time" @@ -180,12 +179,11 @@ func (db *nodeDB) storeInt64(key []byte, n int64) error { func (db *nodeDB) node(id NodeID) *Node { blob, err := db.lvl.Get(makeKey(id, nodeDBDiscoverRoot), nil) if err != nil { - log.Trace(fmt.Sprintf("failed to retrieve node %v: %v", id, err)) return nil } node := new(Node) if err := rlp.DecodeBytes(blob, node); err != nil { - log.Warn(fmt.Sprintf("failed to decode node RLP: %v", err)) + log.Error("Failed to decode node RLP", "err", err) return nil } node.sha = crypto.Keccak256Hash(node.ID[:]) @@ -233,7 +231,7 @@ func (db *nodeDB) expirer() { select { case <-tick: if err := db.expireNodes(); err != nil { - log.Error(fmt.Sprintf("Failed to expire nodedb items: %v", err)) + log.Error("Failed to expire nodedb items", "err", err) } case <-db.quit: @@ -352,7 +350,7 @@ func nextNode(it iterator.Iterator) *Node { } var n Node if err := rlp.DecodeBytes(it.Value(), &n); err != nil { - log.Warn(fmt.Sprintf("invalid node %x: %v", id, err)) + log.Warn("Failed to decode node RLP", "id", id, "err", err) continue } return &n |