mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-11-10 17:36:59 +01:00
Only avoids sending a message for the request state if it is a new open request
This commit is contained in:
@@ -230,13 +230,17 @@ class PoolRequests {
|
|||||||
sync: (NormalizedRelayUrl, Command) -> Unit,
|
sync: (NormalizedRelayUrl, Command) -> Unit,
|
||||||
) {
|
) {
|
||||||
relaysToUpdate.forEach { relay ->
|
relaysToUpdate.forEach { relay ->
|
||||||
|
sendToRelayIfChanged(subId, relay) { cmd ->
|
||||||
|
if (cmd is ReqCmd) {
|
||||||
val currentState = relayState.get(subId)?.currentState(relay)
|
val currentState = relayState.get(subId)?.currentState(relay)
|
||||||
|
|
||||||
if (currentState == ReqSubStatus.SENT || currentState == ReqSubStatus.QUERYING_PAST) {
|
if (currentState == ReqSubStatus.SENT || currentState == ReqSubStatus.QUERYING_PAST) {
|
||||||
// sending multiple REQs triggers multiple EOSEs back and we then don't know which
|
// sending multiple REQs triggers multiple EOSEs back and we then don't know which
|
||||||
// one is which.
|
// one is which.
|
||||||
} else {
|
} else {
|
||||||
sendToRelayIfChanged(subId, relay) { cmd ->
|
sync(relay, cmd)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
sync(relay, cmd)
|
sync(relay, cmd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user