update go-nostr keyer interface and make req --auth work again.

This commit is contained in:
fiatjaf
2024-09-22 19:21:41 -03:00
parent 43fe41df5d
commit d7c0ff2bb7
7 changed files with 22 additions and 14 deletions

View File

@@ -119,6 +119,13 @@ func connectToAllRelays(
forcePreAuth bool,
opts ...nostr.PoolOption,
) []*nostr.Relay {
sys.Pool = nostr.NewSimplePool(context.Background(),
append(opts,
nostr.WithEventMiddleware(sys.TrackEventHints),
nostr.WithPenaltyBox(),
)...,
)
relays := make([]*nostr.Relay, 0, len(relayUrls))
relayLoop:
for _, url := range relayUrls {
@@ -137,7 +144,7 @@ relayLoop:
if (*challengeTag)[1] == "" {
return fmt.Errorf("auth not received yet *****")
}
return signer(authEvent)
return signer(ctx, nostr.RelayEvent{Event: authEvent, Relay: relay})
}); err == nil {
// auth succeeded
break challengeWaitLoop