aboutsummaryrefslogtreecommitdiffstats
path: root/les/sync.go
diff options
context:
space:
mode:
Diffstat (limited to 'les/sync.go')
-rw-r--r--les/sync.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/les/sync.go b/les/sync.go
index c143cb145..c0e17f97d 100644
--- a/les/sync.go
+++ b/les/sync.go
@@ -17,12 +17,12 @@
package les
import (
+ "context"
"time"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/light"
- "golang.org/x/net/context"
)
const (
@@ -77,8 +77,8 @@ func (pm *ProtocolManager) synchronise(peer *peer) {
return
}
- ctx, _ := context.WithTimeout(context.Background(), time.Second*5)
+ ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
+ defer cancel()
pm.blockchain.(*light.LightChain).SyncCht(ctx)
-
pm.downloader.Synchronise(peer.id, peer.Head(), peer.Td(), downloader.LightSync)
}