mirror of
https://github.com/scsibug/nostr-rs-relay.git
synced 2024-11-14 15:09:07 -05:00
Correctly replace subscriptions if ID matches
This commit is contained in:
parent
1a0f66a518
commit
5bc36cc591
|
@ -55,9 +55,11 @@ impl Proto {
|
|||
info!("Dropping subscription with huge ({}) length", sub_id_len);
|
||||
return;
|
||||
}
|
||||
// check if an existing subscription exists.
|
||||
// check if an existing subscription exists, and replace if so
|
||||
if self.subscriptions.contains_key(&k) {
|
||||
info!("Client requested a subscription with an already-existing key");
|
||||
self.subscriptions.remove(&k);
|
||||
self.subscriptions.insert(k, s);
|
||||
info!("Replaced existing subscription");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user