diff options
author | Nick Johnson <arachnid@notdot.net> | 2017-07-05 17:42:37 +0800 |
---|---|---|
committer | Nick Johnson <arachnid@notdot.net> | 2017-07-05 18:13:16 +0800 |
commit | fe13949d9d938316c2c1b037b2cbce8e7bead525 (patch) | |
tree | b0aeafee58c6476b5f824e5a78288be9b406b7b8 /eth/downloader/peer.go | |
parent | be8f8409bc7f0f3124b7ebd1480337e4b1942113 (diff) | |
download | go-tangerine-fe13949d9d938316c2c1b037b2cbce8e7bead525.tar go-tangerine-fe13949d9d938316c2c1b037b2cbce8e7bead525.tar.gz go-tangerine-fe13949d9d938316c2c1b037b2cbce8e7bead525.tar.bz2 go-tangerine-fe13949d9d938316c2c1b037b2cbce8e7bead525.tar.lz go-tangerine-fe13949d9d938316c2c1b037b2cbce8e7bead525.tar.xz go-tangerine-fe13949d9d938316c2c1b037b2cbce8e7bead525.tar.zst go-tangerine-fe13949d9d938316c2c1b037b2cbce8e7bead525.zip |
eth/downloader: Doc fixes
Diffstat (limited to 'eth/downloader/peer.go')
-rw-r--r-- | eth/downloader/peer.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/eth/downloader/peer.go b/eth/downloader/peer.go index 96870da50..d0dc9a8aa 100644 --- a/eth/downloader/peer.go +++ b/eth/downloader/peer.go @@ -45,7 +45,7 @@ var ( errNotRegistered = errors.New("peer is not registered") ) -// peer represents an active peer from which hashes and blocks are retrieved. +// peerConnection represents an active peer from which hashes and blocks are retrieved. type peerConnection struct { id string // Unique identifier of the peer @@ -75,12 +75,14 @@ type peerConnection struct { lock sync.RWMutex } +// LightPeer encapsulates the methods required to synchronise with a remote light peer. type LightPeer interface { Head() (common.Hash, *big.Int) RequestHeadersByHash(common.Hash, int, int, bool) error RequestHeadersByNumber(uint64, int, int, bool) error } +// Peer encapsulates the methods required to synchronise with a remote full peer. type Peer interface { LightPeer RequestBodies([]common.Hash) error @@ -110,7 +112,7 @@ func (w *lightPeerWrapper) RequestNodeData([]common.Hash) error { panic("RequestNodeData not supported in light client mode sync") } -// newPeerConnection creates a new downloader peer +// newPeerConnection creates a new downloader peer. func newPeerConnection(id string, version int, peer Peer, logger log.Logger) *peerConnection { return &peerConnection{ id: id, |