mirror of
https://github.com/lnbits/lnbits.git
synced 2025-10-10 12:32:34 +02:00
take extra care on check_internal()
This commit is contained in:
@@ -284,7 +284,13 @@ def delete_payment(checking_id: str) -> None:
|
|||||||
|
|
||||||
def check_internal(payment_hash: str) -> Optional[str]:
|
def check_internal(payment_hash: str) -> Optional[str]:
|
||||||
with open_db() as db:
|
with open_db() as db:
|
||||||
row = db.fetchone("SELECT checking_id FROM apipayments WHERE hash = ?", (payment_hash,))
|
row = db.fetchone(
|
||||||
|
"""
|
||||||
|
SELECT checking_id FROM apipayments
|
||||||
|
WHERE hash = ? AND pending AND amount > 0
|
||||||
|
""",
|
||||||
|
(payment_hash,),
|
||||||
|
)
|
||||||
if not row:
|
if not row:
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user