add LNURLp switch

This commit is contained in:
Peter Rounce 2022-09-19 06:40:24 +00:00
parent 4a38533cec
commit 8d01474d5f
8 changed files with 40 additions and 40 deletions

View file

@ -10,6 +10,11 @@ import (
)
func lnurlp_callback(w http.ResponseWriter, r *http.Request) {
if os.Getenv("FUNCTION_LNURLP") != "ENABLE" {
log.Debug("LNURLp function is not enabled")
return
}
name := mux.Vars(r)["name"]
amount := r.URL.Query().Get("amount")
@ -60,6 +65,10 @@ func lnurlp_callback(w http.ResponseWriter, r *http.Request) {
return
}
go monitor_invoice_state(r_hash)
log.Debug("sending 'status OK' response");
jsonData := []byte(`{` +
`"status":"OK",` +
`"routes":[],` +
@ -69,6 +78,4 @@ func lnurlp_callback(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
w.Write(jsonData)
go monitor_invoice_state(r_hash)
}