diff options
Diffstat (limited to 'eth/downloader/peer.go')
-rw-r--r-- | eth/downloader/peer.go | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/eth/downloader/peer.go b/eth/downloader/peer.go index 8ef017df7..43b50079b 100644 --- a/eth/downloader/peer.go +++ b/eth/downloader/peer.go @@ -5,14 +5,13 @@ package downloader import ( "errors" + "fmt" "math" "sync" "sync/atomic" "time" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/logger" - "github.com/ethereum/go-ethereum/logger/glog" "gopkg.in/fatih/set.v0" ) @@ -100,9 +99,6 @@ func (p *peer) SetIdle() { if next == 1 { p.Demote() } - if prev != next { - glog.V(logger.Detail).Infof("%s: changing block download capacity from %d to %d", p.id, prev, next) - } break } } @@ -135,6 +131,15 @@ func (p *peer) Demote() { } } +// String implements fmt.Stringer. +func (p *peer) String() string { + return fmt.Sprintf("Peer %s [%s]", p.id, + fmt.Sprintf("reputation %3d, ", atomic.LoadInt32(&p.rep))+ + fmt.Sprintf("capacity %3d, ", atomic.LoadInt32(&p.capacity))+ + fmt.Sprintf("ignored %4d", p.ignored.Size()), + ) +} + // peerSet represents the collection of active peer participating in the block // download procedure. type peerSet struct { |