mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-07-02 11:31:01 +02:00
simplify subscription closing.
This commit is contained in:
17
relay.go
17
relay.go
@ -482,15 +482,14 @@ func (r *Relay) PrepareSubscription(ctx context.Context, filters Filters, opts .
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
|
||||
sub := &Subscription{
|
||||
Relay: r,
|
||||
Context: ctx,
|
||||
cancel: cancel,
|
||||
counter: int(current),
|
||||
Events: make(chan *Event),
|
||||
events: make(chan *Event),
|
||||
EndOfStoredEvents: make(chan struct{}),
|
||||
Filters: filters,
|
||||
closeEventsChannel: make(chan struct{}),
|
||||
Relay: r,
|
||||
Context: ctx,
|
||||
cancel: cancel,
|
||||
counter: int(current),
|
||||
Events: make(chan *Event),
|
||||
events: make(chan *Event),
|
||||
EndOfStoredEvents: make(chan struct{}),
|
||||
Filters: filters,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
|
Reference in New Issue
Block a user