mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-03-17 13:22:56 +01:00
nip46: client small tweaks.
This commit is contained in:
parent
2a85932a4f
commit
76997c619b
@ -109,10 +109,12 @@ func NewBunker(
|
||||
}
|
||||
|
||||
go func() {
|
||||
now := nostr.Now()
|
||||
events := pool.SubMany(ctx, relays, nostr.Filters{
|
||||
{
|
||||
Tags: nostr.TagMap{"p": []string{clientPublicKey}},
|
||||
Kinds: []int{nostr.KindNostrConnect},
|
||||
Since: &now,
|
||||
},
|
||||
})
|
||||
for ie := range events {
|
||||
@ -202,8 +204,8 @@ func (bunker *BunkerClient) RPC(ctx context.Context, method string, params []str
|
||||
|
||||
respWaiter := make(chan Response)
|
||||
bunker.listeners.Store(id, respWaiter)
|
||||
|
||||
hasWorked := false
|
||||
|
||||
for _, r := range bunker.relays {
|
||||
relay, err := bunker.pool.EnsureRelay(r)
|
||||
if err == nil {
|
||||
@ -211,6 +213,7 @@ func (bunker *BunkerClient) RPC(ctx context.Context, method string, params []str
|
||||
}
|
||||
relay.Publish(ctx, evt)
|
||||
}
|
||||
|
||||
if !hasWorked {
|
||||
return "", fmt.Errorf("couldn't connect to any relay")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user