log errors on faulty lnpay webhooks.
This commit is contained in:
parent
a198842f50
commit
a67b93108b
1 changed files with 5 additions and 1 deletions
|
|
@ -110,7 +110,11 @@ class LNPayWallet(Wallet):
|
||||||
|
|
||||||
async def webhook_listener(self):
|
async def webhook_listener(self):
|
||||||
text: str = await request.get_data()
|
text: str = await request.get_data()
|
||||||
|
try:
|
||||||
data = json.loads(text)
|
data = json.loads(text)
|
||||||
|
except json.decoder.JSONDecodeError:
|
||||||
|
print(f"got something wrong on lnpay webhook endpoint: {text[:200]}")
|
||||||
|
data = None
|
||||||
if type(data) is not dict or "event" not in data or data["event"].get("name") != "wallet_receive":
|
if type(data) is not dict or "event" not in data or data["event"].get("name") != "wallet_receive":
|
||||||
return "", HTTPStatus.NO_CONTENT
|
return "", HTTPStatus.NO_CONTENT
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue