diff options
author | zelig <viktor.tron@gmail.com> | 2015-03-04 03:06:15 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2015-03-04 03:06:15 +0800 |
commit | 2c616bd2795974877b0d3e23e99f6eff9e775218 (patch) | |
tree | 66dc8e84eddc5295d483a6ca2f577eead37102d2 /blockpool/config_test.go | |
parent | 47278a6e4eb4b8dc02ff322ba24c9c225267ffe5 (diff) | |
download | go-tangerine-2c616bd2795974877b0d3e23e99f6eff9e775218.tar go-tangerine-2c616bd2795974877b0d3e23e99f6eff9e775218.tar.gz go-tangerine-2c616bd2795974877b0d3e23e99f6eff9e775218.tar.bz2 go-tangerine-2c616bd2795974877b0d3e23e99f6eff9e775218.tar.lz go-tangerine-2c616bd2795974877b0d3e23e99f6eff9e775218.tar.xz go-tangerine-2c616bd2795974877b0d3e23e99f6eff9e775218.tar.zst go-tangerine-2c616bd2795974877b0d3e23e99f6eff9e775218.zip |
partial fix to idle best peer issue
- best peer cannot be idle for more than idleBestPeerTimeout
- introduce ErrIdleTooLong fatal error
- modify default values
Diffstat (limited to 'blockpool/config_test.go')
-rw-r--r-- | blockpool/config_test.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/blockpool/config_test.go b/blockpool/config_test.go index c06649024..d5540c864 100644 --- a/blockpool/config_test.go +++ b/blockpool/config_test.go @@ -20,12 +20,13 @@ func TestBlockPoolConfig(t *testing.T) { test.CheckDuration("BlocksRequestInterval", c.BlocksRequestInterval, blocksRequestInterval, t) test.CheckDuration("BlockHashesTimeout", c.BlockHashesTimeout, blockHashesTimeout, t) test.CheckDuration("BlocksTimeout", c.BlocksTimeout, blocksTimeout, t) + test.CheckDuration("IdleBestPeerTimeout", c.IdleBestPeerTimeout, idleBestPeerTimeout, t) } func TestBlockPoolOverrideConfig(t *testing.T) { test.LogInit() blockPool := &BlockPool{Config: &Config{}} - c := &Config{128, 32, 1, 0, 300 * time.Millisecond, 100 * time.Millisecond, 90 * time.Second, 0} + c := &Config{128, 32, 1, 0, 300 * time.Millisecond, 100 * time.Millisecond, 90 * time.Second, 0, 30 * time.Second} blockPool.Config = c blockPool.Start() @@ -37,4 +38,5 @@ func TestBlockPoolOverrideConfig(t *testing.T) { test.CheckDuration("BlocksRequestInterval", c.BlocksRequestInterval, 100*time.Millisecond, t) test.CheckDuration("BlockHashesTimeout", c.BlockHashesTimeout, 90*time.Second, t) test.CheckDuration("BlocksTimeout", c.BlocksTimeout, blocksTimeout, t) + test.CheckDuration("IdleBestPeerTimeout", c.IdleBestPeerTimeout, 30*time.Second, t) } |