mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-11-18 10:06:27 +01:00
replace deprecated functions in multiple places.
This commit is contained in:
@@ -113,13 +113,11 @@ 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,
|
||||
LimitZero: true,
|
||||
},
|
||||
events := pool.SubscribeMany(ctx, relays, nostr.Filter{
|
||||
Tags: nostr.TagMap{"p": []string{clientPublicKey}},
|
||||
Kinds: []int{nostr.KindNostrConnect},
|
||||
Since: &now,
|
||||
LimitZero: true,
|
||||
}, nostr.WithLabel("bunker46client"))
|
||||
for ie := range events {
|
||||
if ie.Kind != nostr.KindNostrConnect {
|
||||
|
||||
@@ -94,12 +94,12 @@ func (p *DynamicSigner) HandleRequest(ctx context.Context, event *nostr.Event) (
|
||||
fmt.Errorf("event kind is %d, but we expected %d", event.Kind, nostr.KindNostrConnect)
|
||||
}
|
||||
|
||||
handler := event.Tags.GetFirst([]string{"p", ""})
|
||||
if handler == nil || !nostr.IsValid32ByteHex((*handler)[1]) {
|
||||
handler := event.Tags.Find("p")
|
||||
if handler == nil || !nostr.IsValid32ByteHex(handler[1]) {
|
||||
return req, resp, eventResponse, fmt.Errorf("invalid \"p\" tag")
|
||||
}
|
||||
|
||||
handlerPubkey := (*handler)[1]
|
||||
handlerPubkey := handler[1]
|
||||
handlerSecret, err := p.getHandlerSecretKey(handlerPubkey)
|
||||
if err != nil {
|
||||
return req, resp, eventResponse, fmt.Errorf("no private key for %s: %w", handlerPubkey, err)
|
||||
|
||||
Reference in New Issue
Block a user