Added unique hash check to lnurlw
This commit is contained in:
parent
ccb9d107d5
commit
52956a62a2
1 changed files with 9 additions and 0 deletions
|
|
@ -38,6 +38,15 @@ async def api_lnurl_multi_response(unique_hash, id_unique_hash):
|
||||||
if link.is_spent:
|
if link.is_spent:
|
||||||
return jsonify({"status": "ERROR", "reason": "Withdraw is spent."}), HTTPStatus.OK
|
return jsonify({"status": "ERROR", "reason": "Withdraw is spent."}), HTTPStatus.OK
|
||||||
|
|
||||||
|
useslist = link.usescsv.split(",")
|
||||||
|
found = False
|
||||||
|
for x in useslist:
|
||||||
|
tohash = link.id + link.unique_hash + str(x)
|
||||||
|
if id_unique_hash == shortuuid.uuid(name=tohash):
|
||||||
|
found = True
|
||||||
|
if not found:
|
||||||
|
return jsonify({"status": "ERROR", "reason": "LNURL-withdraw not found."}), HTTPStatus.OK
|
||||||
|
|
||||||
return jsonify(link.lnurl_response.dict()), HTTPStatus.OK
|
return jsonify(link.lnurl_response.dict()), HTTPStatus.OK
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue