nip46: dynamic signer to store sessions associated with the handler pubkey to prevent stupid bugs when the same client try to use two different bunkers.

This commit is contained in:
fiatjaf
2025-07-18 14:36:42 -03:00
parent 33838a4801
commit 7cbca5f040
3 changed files with 35 additions and 44 deletions

View File

@@ -30,14 +30,6 @@ func NewStaticKeySigner(secretKey [32]byte) StaticKeySigner {
}
}
func (p *StaticKeySigner) GetSession(clientPubkey nostr.PubKey) (Session, bool) {
p.Lock()
defer p.Unlock()
session, ok := p.sessions[clientPubkey]
return session, ok
}
func (p *StaticKeySigner) getOrCreateSession(clientPubkey nostr.PubKey) (Session, error) {
p.Lock()
defer p.Unlock()