diff --git a/lib/jsonrpc/client.go b/lib/jsonrpc/client.go index 126da7d04..81cf4ec0a 100644 --- a/lib/jsonrpc/client.go +++ b/lib/jsonrpc/client.go @@ -189,12 +189,13 @@ func (c *client) makeOutChan(ctx context.Context, ftyp reflect.Type, valOut int) }, } - switch chosen, _, _ := reflect.Select(cases); chosen { + chosen, _, _ := reflect.Select(cases) + bufLk.Lock() + + switch chosen { case 0: - bufLk.Lock() buf.Init() case 1: - bufLk.Lock() buf.Remove(front) } }