mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-06-13 10:21:02 +02:00
I think this handles CLOSED messages better.
This commit is contained in:
parent
14fa7a0358
commit
9c692af624
@ -110,9 +110,9 @@ func (sub *Subscription) dispatchEose() {
|
|||||||
func (sub *Subscription) handleClosed(reason string) {
|
func (sub *Subscription) handleClosed(reason string) {
|
||||||
go func() {
|
go func() {
|
||||||
sub.ClosedReason <- reason
|
sub.ClosedReason <- reason
|
||||||
}()
|
|
||||||
sub.live.Store(false) // set this so we don't send an unnecessary CLOSE to the relay
|
sub.live.Store(false) // set this so we don't send an unnecessary CLOSE to the relay
|
||||||
sub.Unsub()
|
sub.Unsub()
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unsub closes the subscription, sending "CLOSE" to relay as in NIP-01.
|
// Unsub closes the subscription, sending "CLOSE" to relay as in NIP-01.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user