avoid sending to closed Events/UniqueEvents channels.

This commit is contained in:
fiatjaf
2022-02-07 11:33:45 -03:00
parent 7760f53ce2
commit ef1f548212
2 changed files with 11 additions and 4 deletions

View File

@@ -152,9 +152,11 @@ func (r *RelayPool) Add(url string, policy RelayPoolPolicy) error {
continue
}
subscription.Events <- EventMessage{
Relay: nm,
Event: event,
if !subscription.stopped {
subscription.Events <- EventMessage{
Relay: nm,
Event: event,
}
}
}
}