From 5f78b2d68c04dea2667da0060ab6d260da85aad9 Mon Sep 17 00:00:00 2001 From: Asara Date: Mon, 1 May 2023 18:01:46 -0400 Subject: [PATCH] More testing --- nostr/nostr.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nostr/nostr.go b/nostr/nostr.go index 454f058..9d60e2d 100644 --- a/nostr/nostr.go +++ b/nostr/nostr.go @@ -50,6 +50,12 @@ func RequestNostrAddr(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusConflict) return } + rKey = getRkey("requested", r.FormValue("Name"), getHostname(r.Host)) + exists = redisCli.Client.Exists(ctx, rKey) + if exists.Val() == 1 { + w.WriteHeader(http.StatusConflict) + return + } // get the hexkey hexKey, err := convertNpubToHex(r.FormValue("Key")) @@ -76,7 +82,8 @@ func RequestNostrAddr(w http.ResponseWriter, r *http.Request) { // generate the payment request exp := time.Until(time.Now().Add(time.Minute * 15)) - paymentReq, err := lnd.Request(rKey, jsonUser, exp) + // paymentReq, err := lnd.Request(rKey, jsonUser, exp) + _, err = lnd.Request(rKey, jsonUser, exp) if err != nil { w.WriteHeader(http.StatusServiceUnavailable) return