small things.

This commit is contained in:
fiatjaf 2025-04-03 00:23:26 -03:00
parent 0d5daf66bf
commit b48d2249b9
3 changed files with 4 additions and 4 deletions

View File

@ -39,7 +39,7 @@ func ValidateAuthEvent(event *nostr.Event, challenge string, relayURL string) (p
return "", false
}
if event.Tags.GetFirst([]string{"challenge", challenge}) == nil {
if event.Tags.FindWithValue("challenge", challenge) == nil {
return "", false
}

View File

@ -104,7 +104,7 @@ func Decrypt(b64ciphertextWrapped string, conversationKey [32]byte) (string, err
decoded, err := base64.StdEncoding.DecodeString(b64ciphertextWrapped)
if err != nil {
return "", fmt.Errorf("invalid base64")
return "", fmt.Errorf("invalid base64: %w", err)
}
if decoded[0] != version {

View File

@ -142,11 +142,11 @@ func loadWallet(
for ie := range deletions {
w.Lock()
if !eosed {
for _, tag := range ie.Event.Tags.All([]string{"e", ""}) {
for tag := range ie.Event.Tags.FindAll("e") {
w.pendingDeletions = append(w.pendingDeletions, tag[1])
}
} else {
for _, tag := range ie.Event.Tags.All([]string{"e", ""}) {
for tag := range ie.Event.Tags.FindAll("e") {
w.removeDeletedToken(tag[1])
}
}