Skip to content

Commit ed07ffc

Browse files
committed
downloader: fixed tests with low ttl
1 parent dcf1a19 commit ed07ffc

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎eth/downloader/downloader.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ import (
2020
const (
2121
maxBlockFetch = 256 // Amount of max blocks to be fetched per chunk
2222
peerCountTimeout = 12 * time.Second // Amount of time it takes for the peer handler to ignore minDesiredPeerCount
23-
blockTtl = 20 * time.Second // The amount of time it takes for a block request to time out
2423
hashTtl = 20 * time.Second // The amount of time it takes for a hash request to time out
2524
)
2625

2726
var (
28-
minDesiredPeerCount = 5 // Amount of peers desired to start syncing
27+
minDesiredPeerCount = 5 // Amount of peers desired to start syncing
28+
blockTtl = 20 * time.Second // The amount of time it takes for a block request to time out
2929

3030
errLowTd = errors.New("peer's TD is too low")
3131
errBusy = errors.New("busy")

‎eth/downloader/downloader_test.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ func TestDownload(t *testing.T) {
110110
glog.SetToStderr(true)
111111

112112
minDesiredPeerCount = 4
113+
blockTtl = 1 * time.Second
113114

114115
hashes := createHashes(0, 1000)
115116
blocks := createBlocksFromHashes(hashes)

0 commit comments

Comments
 (0)