mirror of
https://github.com/believethehype/nostdress.git
synced 2026-06-21 07:48:23 -07:00
fix inconsistency in name saving.
This commit is contained in:
@@ -21,10 +21,10 @@ type Params struct {
|
||||
}
|
||||
|
||||
func SaveName(name string, params *Params, providedPin string) (pin string, err error) {
|
||||
key := []byte(name + "@" + s.Domain)
|
||||
key := []byte(name)
|
||||
|
||||
mac := hmac.New(sha256.New, []byte(s.Secret))
|
||||
mac.Write(key)
|
||||
mac.Write([]byte(name + "@" + s.Domain))
|
||||
pin = hex.EncodeToString(mac.Sum(nil))
|
||||
|
||||
if _, closer, err := db.Get(key); err == nil {
|
||||
|
||||
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
@@ -50,6 +51,11 @@ func makeInvoice(params *Params, msat int) (bolt11 string, err error) {
|
||||
}
|
||||
}
|
||||
|
||||
log.Debug().Int("msatoshi", msat).
|
||||
Interface("backend", backend).
|
||||
Str("description_hash", hex.EncodeToString(h[:])).
|
||||
Msg("generating invoice")
|
||||
|
||||
// actually generate the invoice
|
||||
return makeinvoice.MakeInvoice(makeinvoice.Params{
|
||||
Msatoshi: int64(msat),
|
||||
|
||||
Reference in New Issue
Block a user