nip60: calling Processed() on deletes.

This commit is contained in:
fiatjaf
2025-08-29 16:23:28 -03:00
parent 76e90481f4
commit aa321f6e7f

View File

@@ -10,10 +10,10 @@ import (
"time" "time"
"fiatjaf.com/nostr" "fiatjaf.com/nostr"
"fiatjaf.com/nostr/nip60/client"
"github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcec/v2"
"github.com/decred/dcrd/dcrec/secp256k1/v4" "github.com/decred/dcrd/dcrec/secp256k1/v4"
"github.com/elnosh/gonuts/cashu/nuts/nut13" "github.com/elnosh/gonuts/cashu/nuts/nut13"
"fiatjaf.com/nostr/nip60/client"
) )
// WalletOptions contains options for loading a wallet // WalletOptions contains options for loading a wallet
@@ -41,6 +41,7 @@ type Wallet struct {
) )
// Processed, if not nil, is called every time a received event is processed // Processed, if not nil, is called every time a received event is processed
// (do not do any wallet operations while handling this as that will cause a mutex deadlock).
Processed func(nostr.Event, error) Processed func(nostr.Event, error)
// Stable is closed when we have gotten an EOSE from all relays // Stable is closed when we have gotten an EOSE from all relays
@@ -155,6 +156,10 @@ func loadWallet(
} }
} }
} }
if w.Processed != nil {
w.Processed(ie.Event, nil)
}
w.Unlock() w.Unlock()
} }
}() }()