aboutsummaryrefslogtreecommitdiffstats
path: root/eth/downloader/peer.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-06-29 22:37:55 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-07-01 00:00:01 +0800
commitaf51dc4d637dbbb0d416032304f84d52d4f6d951 (patch)
tree2d455e99559c58e28bddfb8981d44d844b3cddd1 /eth/downloader/peer.go
parentaac2b6ae4c5cf6f78547159c47f9192babe3e6dd (diff)
downloadgo-tangerine-af51dc4d637dbbb0d416032304f84d52d4f6d951.tar
go-tangerine-af51dc4d637dbbb0d416032304f84d52d4f6d951.tar.gz
go-tangerine-af51dc4d637dbbb0d416032304f84d52d4f6d951.tar.bz2
go-tangerine-af51dc4d637dbbb0d416032304f84d52d4f6d951.tar.lz
go-tangerine-af51dc4d637dbbb0d416032304f84d52d4f6d951.tar.xz
go-tangerine-af51dc4d637dbbb0d416032304f84d52d4f6d951.tar.zst
go-tangerine-af51dc4d637dbbb0d416032304f84d52d4f6d951.zip
eth, eth/downloader: pass the eth protocol version through
Diffstat (limited to 'eth/downloader/peer.go')
-rw-r--r--eth/downloader/peer.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/eth/downloader/peer.go b/eth/downloader/peer.go
index f36e133e4..7176cc06b 100644
--- a/eth/downloader/peer.go
+++ b/eth/downloader/peer.go
@@ -39,11 +39,13 @@ type peer struct {
getHashes hashFetcherFn // Method to retrieve a batch of hashes (mockable for testing)
getBlocks blockFetcherFn // Method to retrieve a batch of blocks (mockable for testing)
+
+ version int // Eth protocol version number to switch strategies
}
// newPeer create a new downloader peer, with specific hash and block retrieval
// mechanisms.
-func newPeer(id string, head common.Hash, getHashes hashFetcherFn, getBlocks blockFetcherFn) *peer {
+func newPeer(id string, version int, head common.Hash, getHashes hashFetcherFn, getBlocks blockFetcherFn) *peer {
return &peer{
id: id,
head: head,
@@ -51,6 +53,7 @@ func newPeer(id string, head common.Hash, getHashes hashFetcherFn, getBlocks blo
getHashes: getHashes,
getBlocks: getBlocks,
ignored: set.New(),
+ version: version,
}
}