From a40e61b4ac44a4f64f057a4220a26cfe4b9dcf03 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 15 Apr 2016 18:05:24 +0200 Subject: rpc: remove NotifierContextKey Context keys must have a unique type in order to prevent any unintented clashes. The code used int(1) as key. Fix it by implementing the pattern recommended by package context. --- eth/downloader/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'eth/downloader') diff --git a/eth/downloader/api.go b/eth/downloader/api.go index 670a3ade3..94cd6515f 100644 --- a/eth/downloader/api.go +++ b/eth/downloader/api.go @@ -85,7 +85,7 @@ type SyncingResult struct { // Syncing provides information when this nodes starts synchronising with the Ethereum network and when it's finished. func (api *PublicDownloaderAPI) Syncing(ctx context.Context) (rpc.Subscription, error) { - notifier, supported := ctx.Value(rpc.NotifierContextKey).(rpc.Notifier) + notifier, supported := rpc.NotifierFromContext(ctx) if !supported { return nil, rpc.ErrNotificationsUnsupported } -- cgit v1.2.3