From 3ef504d185b544b1d3183c250e8c6e0d7ace4414 Mon Sep 17 00:00:00 2001 From: Zsolt Felfoldi Date: Sun, 3 Nov 2019 02:08:08 +0100 Subject: [PATCH] les: priority client info bugfix --- les/api.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/les/api.go b/les/api.go index 6c0ca9066e..d6cb7ddad8 100644 --- a/les/api.go +++ b/les/api.go @@ -97,9 +97,11 @@ func (api *PrivateLightServerAPI) PriorityClientInfo(start, stop enode.ID, maxCo res[ids[maxCount]] = make(map[string]interface{}) ids = ids[:maxCount] } - api.server.clientPool.forClients(ids, func(client *clientInfo, id enode.ID) { - res[id] = api.clientInfo(client, id) - }) + if len(ids) != 0 { + api.server.clientPool.forClients(ids, func(client *clientInfo, id enode.ID) { + res[id] = api.clientInfo(client, id) + }) + } return res }