mirror of
https://github.com/fiatjaf/khatru.git
synced 2026-05-04 18:58:20 +02:00
fix wrong matching on listener remove when router is used.
pablo's crash, see https://t.me/nip29_temp/670
This commit is contained in:
@@ -121,7 +121,7 @@ func (rl *Relay) removeClientAndListeners(ws *WebSocket) {
|
||||
// so its .index reflects its new position on srl.listeners
|
||||
movedSpecs := rl.clients[moved.ws]
|
||||
idx := slices.IndexFunc(movedSpecs, func(ls listenerSpec) bool {
|
||||
return ls.index == movedFromIndex
|
||||
return ls.index == movedFromIndex && ls.subrelay == srl
|
||||
})
|
||||
movedSpecs[idx].index = spec.index
|
||||
rl.clients[moved.ws] = movedSpecs
|
||||
|
||||
Reference in New Issue
Block a user