diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-06-03 23:24:52 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-06-03 23:24:52 +0800 |
commit | 0cd72369f788dd6ef9e515370e049a7447a41a10 (patch) | |
tree | b89fcb6427e045ac4e1c0a658c48d331a62d20df /eth/downloader/queue_test.go | |
parent | 02f785af70d9d91d38ce44163a79c16ab288d55f (diff) | |
parent | 3ec159ab6be4dfcc51e339da562466eea38ce8b5 (diff) | |
download | dexon-0cd72369f788dd6ef9e515370e049a7447a41a10.tar dexon-0cd72369f788dd6ef9e515370e049a7447a41a10.tar.gz dexon-0cd72369f788dd6ef9e515370e049a7447a41a10.tar.bz2 dexon-0cd72369f788dd6ef9e515370e049a7447a41a10.tar.lz dexon-0cd72369f788dd6ef9e515370e049a7447a41a10.tar.xz dexon-0cd72369f788dd6ef9e515370e049a7447a41a10.tar.zst dexon-0cd72369f788dd6ef9e515370e049a7447a41a10.zip |
Merge pull request #1176 from karalabe/congestion-control
eth/downloader: add a basic block download congestion control
Diffstat (limited to 'eth/downloader/queue_test.go')
-rw-r--r-- | eth/downloader/queue_test.go | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/eth/downloader/queue_test.go b/eth/downloader/queue_test.go index b1f3591f3..ee6141f71 100644 --- a/eth/downloader/queue_test.go +++ b/eth/downloader/queue_test.go @@ -1,8 +1,6 @@ package downloader import ( - "testing" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "gopkg.in/fatih/set.v0" @@ -30,32 +28,3 @@ func createBlocksFromHashSet(hashes *set.Set) []*types.Block { return blocks } - -func TestChunking(t *testing.T) { - queue := newQueue() - peer1 := newPeer("peer1", common.Hash{}, nil, nil) - peer2 := newPeer("peer2", common.Hash{}, nil, nil) - - // 99 + 1 (1 == known genesis hash) - hashes := createHashes(0, 99) - queue.Insert(hashes) - - chunk1 := queue.Reserve(peer1, 99) - if chunk1 == nil { - t.Errorf("chunk1 is nil") - t.FailNow() - } - chunk2 := queue.Reserve(peer2, 99) - if chunk2 == nil { - t.Errorf("chunk2 is nil") - t.FailNow() - } - - if len(chunk1.Hashes) != 99 { - t.Error("expected chunk1 hashes to be 99, got", len(chunk1.Hashes)) - } - - if len(chunk2.Hashes) != 1 { - t.Error("expected chunk1 hashes to be 1, got", len(chunk2.Hashes)) - } -} |