@@ -218,7 +218,7 @@ func TestConnectPaidClient(t *testing.T) {
218218 clock mclock.Simulated
219219 db = rawdb .NewMemoryDatabase ()
220220 )
221- pool := newClientPool (db , 1 , 1 , activeBias , & clock , func (id enode.ID ) {})
221+ pool := newClientPool (db , 1 , 1 , defaultConnectedBias , & clock , func (id enode.ID ) {})
222222 defer pool .stop ()
223223 pool .setLimits (10 , uint64 (10 ))
224224 pool .setDefaultFactors (lps.PriceFactors {1 , 0 , 1 }, lps.PriceFactors {1 , 0 , 1 })
@@ -236,7 +236,7 @@ func TestConnectPaidClientToSmallPool(t *testing.T) {
236236 clock mclock.Simulated
237237 db = rawdb .NewMemoryDatabase ()
238238 )
239- pool := newClientPool (db , 1 , 1 , activeBias , & clock , func (id enode.ID ) {})
239+ pool := newClientPool (db , 1 , 1 , defaultConnectedBias , & clock , func (id enode.ID ) {})
240240 defer pool .stop ()
241241 pool .setLimits (10 , uint64 (10 )) // Total capacity limit is 10
242242 pool .setDefaultFactors (lps.PriceFactors {1 , 0 , 1 }, lps.PriceFactors {1 , 0 , 1 })
@@ -256,7 +256,7 @@ func TestConnectPaidClientToFullPool(t *testing.T) {
256256 db = rawdb .NewMemoryDatabase ()
257257 )
258258 removeFn := func (enode.ID ) {} // Noop
259- pool := newClientPool (db , 1 , 1 , activeBias , & clock , removeFn )
259+ pool := newClientPool (db , 1 , 1 , defaultConnectedBias , & clock , removeFn )
260260 defer pool .stop ()
261261 pool .setLimits (10 , uint64 (10 )) // Total capacity limit is 10
262262 pool .setDefaultFactors (lps.PriceFactors {1 , 0 , 1 }, lps.PriceFactors {1 , 0 , 1 })
@@ -285,7 +285,7 @@ func TestPaidClientKickedOut(t *testing.T) {
285285 removeFn := func (id enode.ID ) {
286286 kickedCh <- int (id [0 ])
287287 }
288- pool := newClientPool (db , 1 , 1 , activeBias , & clock , removeFn )
288+ pool := newClientPool (db , 1 , 1 , defaultConnectedBias , & clock , removeFn )
289289 pool .bt .SetExpirationTCs (0 , 0 )
290290 defer pool .stop ()
291291 pool .setLimits (10 , uint64 (10 )) // Total capacity limit is 10
@@ -296,7 +296,7 @@ func TestPaidClientKickedOut(t *testing.T) {
296296 pool .connect (newPoolTestPeer (i , kickedCh ), 1 )
297297 clock .Run (time .Millisecond )
298298 }
299- clock .Run (activeBias + time .Second * 11 )
299+ clock .Run (defaultConnectedBias + time .Second * 11 )
300300 if cap , _ := pool .connect (newPoolTestPeer (11 , kickedCh ), 0 ); cap == 0 {
301301 t .Fatalf ("Free client should be accepted" )
302302 }
@@ -315,7 +315,7 @@ func TestConnectFreeClient(t *testing.T) {
315315 clock mclock.Simulated
316316 db = rawdb .NewMemoryDatabase ()
317317 )
318- pool := newClientPool (db , 1 , 1 , activeBias , & clock , func (id enode.ID ) {})
318+ pool := newClientPool (db , 1 , 1 , defaultConnectedBias , & clock , func (id enode.ID ) {})
319319 defer pool .stop ()
320320 pool .setLimits (10 , uint64 (10 ))
321321 pool .setDefaultFactors (lps.PriceFactors {1 , 0 , 1 }, lps.PriceFactors {1 , 0 , 1 })
@@ -333,7 +333,7 @@ func TestConnectFreeClientToFullPool(t *testing.T) {
333333 db = rawdb .NewMemoryDatabase ()
334334 )
335335 removeFn := func (enode.ID ) {} // Noop
336- pool := newClientPool (db , 1 , 1 , activeBias , & clock , removeFn )
336+ pool := newClientPool (db , 1 , 1 , defaultConnectedBias , & clock , removeFn )
337337 defer pool .stop ()
338338 pool .setLimits (10 , uint64 (10 )) // Total capacity limit is 10
339339 pool .setDefaultFactors (lps.PriceFactors {1 , 0 , 1 }, lps.PriceFactors {1 , 0 , 1 })
@@ -362,7 +362,7 @@ func TestFreeClientKickedOut(t *testing.T) {
362362 kicked = make (chan int , 100 )
363363 )
364364 removeFn := func (id enode.ID ) { kicked <- int (id [0 ]) }
365- pool := newClientPool (db , 1 , 1 , activeBias , & clock , removeFn )
365+ pool := newClientPool (db , 1 , 1 , defaultConnectedBias , & clock , removeFn )
366366 defer pool .stop ()
367367 pool .setLimits (10 , uint64 (10 )) // Total capacity limit is 10
368368 pool .setDefaultFactors (lps.PriceFactors {1 , 0 , 1 }, lps.PriceFactors {1 , 0 , 1 })
@@ -403,7 +403,7 @@ func TestPositiveBalanceCalculation(t *testing.T) {
403403 kicked = make (chan int , 10 )
404404 )
405405 removeFn := func (id enode.ID ) { kicked <- int (id [0 ]) } // Noop
406- pool := newClientPool (db , 1 , 1 , activeBias , & clock , removeFn )
406+ pool := newClientPool (db , 1 , 1 , defaultConnectedBias , & clock , removeFn )
407407 defer pool .stop ()
408408 pool .setLimits (10 , uint64 (10 )) // Total capacity limit is 10
409409 pool .setDefaultFactors (lps.PriceFactors {1 , 0 , 1 }, lps.PriceFactors {1 , 0 , 1 })
@@ -426,7 +426,7 @@ func TestDowngradePriorityClient(t *testing.T) {
426426 kicked = make (chan int , 10 )
427427 )
428428 removeFn := func (id enode.ID ) { kicked <- int (id [0 ]) } // Noop
429- pool := newClientPool (db , 1 , 1 , activeBias , & clock , removeFn )
429+ pool := newClientPool (db , 1 , 1 , defaultConnectedBias , & clock , removeFn )
430430 defer pool .stop ()
431431 pool .setLimits (10 , uint64 (10 )) // Total capacity limit is 10
432432 pool .setDefaultFactors (lps.PriceFactors {1 , 0 , 1 }, lps.PriceFactors {1 , 0 , 1 })
@@ -460,7 +460,7 @@ func TestNegativeBalanceCalculation(t *testing.T) {
460460 clock mclock.Simulated
461461 db = rawdb .NewMemoryDatabase ()
462462 )
463- pool := newClientPool (db , 1 , 1 , activeBias , & clock , func (id enode.ID ) {})
463+ pool := newClientPool (db , 1 , 1 , defaultConnectedBias , & clock , func (id enode.ID ) {})
464464 defer pool .stop ()
465465 pool .setLimits (10 , uint64 (10 )) // Total capacity limit is 10
466466 pool .setDefaultFactors (lps.PriceFactors {1e-3 , 0 , 1 }, lps.PriceFactors {1e-3 , 0 , 1 })
@@ -495,7 +495,7 @@ func TestInactiveClient(t *testing.T) {
495495 clock mclock.Simulated
496496 db = rawdb .NewMemoryDatabase ()
497497 )
498- pool := newClientPool (db , 1 , 1 , activeBias , & clock , func (id enode.ID ) {})
498+ pool := newClientPool (db , 1 , 1 , defaultConnectedBias , & clock , func (id enode.ID ) {})
499499 defer pool .stop ()
500500 pool .setLimits (2 , uint64 (2 ))
501501
0 commit comments