From 4a307160d54f280822be6506ba31ff2f5e0a9844 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 15 Nov 2019 12:35:08 +0100 Subject: [PATCH] les: cancel context in testRequest --- les/api_test.go | 3 ++- les/clientpool.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/les/api_test.go b/les/api_test.go index 660af8eeec..06a519b62b 100644 --- a/les/api_test.go +++ b/les/api_test.go @@ -326,7 +326,8 @@ func testRequest(ctx context.Context, t *testing.T, client *rpc.Client) bool { var res string var addr common.Address rand.Read(addr[:]) - c, _ := context.WithTimeout(ctx, time.Second*12) + c, cancel := context.WithTimeout(ctx, time.Second*12) + defer cancel() err := client.CallContext(c, &res, "eth_getBalance", addr, "latest") if err != nil { t.Log("request error:", err) diff --git a/les/clientpool.go b/les/clientpool.go index 0169dc706b..b553783acd 100644 --- a/les/clientpool.go +++ b/les/clientpool.go @@ -32,7 +32,7 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/rlp" - "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru" ) const (