fix bug when removing key from listenership.

This commit is contained in:
fiatjaf
2021-01-14 22:07:53 -03:00
parent 3132195275
commit 4357bd1beb

View File

@@ -37,6 +37,11 @@ func unwatchPubKey(excludedKey string, ws *websocket.Conn) {
if existingWs == ws {
continue
}
if i == len(wss) {
// if we reach this point it is because the key we were
// excluding wasn't here in the first place
return
}
newWss[i] = existingWs
i++
}