mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-09-25 11:16:57 +02:00
Fix execution sequence
This commit is contained in:
committed by
fiatjaf
parent
11f4090639
commit
d7d4c62602
9
relay.go
9
relay.go
@@ -230,14 +230,13 @@ func (r *Relay) Publish(ctx context.Context, event Event) Status {
|
||||
|
||||
// publish event
|
||||
if err := r.Connection.WriteJSON([]interface{}{"EVENT", event}); err != nil {
|
||||
// update status (this will be returned later)
|
||||
mu.Lock()
|
||||
status = PublishStatusSent
|
||||
mu.Unlock()
|
||||
return status
|
||||
}
|
||||
|
||||
// update status (this will be returned later)
|
||||
mu.Lock()
|
||||
status = PublishStatusSent
|
||||
mu.Unlock()
|
||||
|
||||
sub := r.Subscribe(ctx, Filters{Filter{IDs: []string{event.ID}}})
|
||||
defer mu.Unlock()
|
||||
for {
|
||||
|
Reference in New Issue
Block a user