fix: domain variable assignment in pay_lnurl.

This commit is contained in:
fiatjaf 2020-10-14 22:44:23 -03:00
parent 0dc60d4795
commit ec4b558638

View File

@ -147,6 +147,8 @@ async def api_payments_create():
}
)
async def api_payments_pay_lnurl():
domain = urlparse(g.data["callback"]).netloc
try:
r = httpx.get(
g.data["callback"],
@ -160,7 +162,6 @@ async def api_payments_pay_lnurl():
params = json.loads(r.text)
if params.get("status") == "ERROR":
domain = urlparse(g.data["callback"]).netloc
return jsonify({"message": f"{domain} said: '{params.get('reason', '')}'"}), HTTPStatus.BAD_REQUEST
invoice = bolt11.decode(params["pr"])