mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-11-10 20:06:37 +01:00
Avoid sending close to subs that are already closed.
This commit is contained in:
@@ -231,7 +231,10 @@ class NostrClient(
|
||||
|
||||
if (newFilters.isNullOrEmpty()) {
|
||||
// some relays are not in this sub anymore. Stop their subscriptions
|
||||
if (!oldFilters.isNullOrEmpty()) {
|
||||
// only update if the old filters are not already closed.
|
||||
relayPool.close(relay, subId)
|
||||
}
|
||||
} else if (oldFilters.isNullOrEmpty()) {
|
||||
// new relays were added. Start a new sub in them
|
||||
relayPool.sendRequest(relay, subId, newFilters)
|
||||
@@ -267,7 +270,10 @@ class NostrClient(
|
||||
|
||||
if (newFilters.isNullOrEmpty()) {
|
||||
// some relays are not in this sub anymore. Stop their subscriptions
|
||||
if (!oldFilters.isNullOrEmpty()) {
|
||||
// only update if the old filters are not already closed.
|
||||
relayPool.close(relay, subId)
|
||||
}
|
||||
} else if (oldFilters.isNullOrEmpty()) {
|
||||
// new relays were added. Start a new sub in them
|
||||
relayPool.sendCount(relay, subId, newFilters)
|
||||
|
||||
Reference in New Issue
Block a user