diff options
Diffstat (limited to 'eth/downloader/peer.go')
-rw-r--r-- | eth/downloader/peer.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/eth/downloader/peer.go b/eth/downloader/peer.go index 5d5208e8e..ec2a61550 100644 --- a/eth/downloader/peer.go +++ b/eth/downloader/peer.go @@ -20,6 +20,12 @@ type blockFetcherFn func([]common.Hash) error // XXX make threadsafe!!!! type peers map[string]*peer +func (p peers) reset() { + for _, peer := range p { + p.reset() + } +} + func (p peers) get(state int) []*peer { var peers []*peer for _, peer := range p { @@ -128,3 +134,7 @@ func (p *peer) demote() { p.rep = 0 } } + +func (p *peer) reset() { + p.state = idleState +} |