This commit is contained in:
ben 2022-11-24 00:34:46 +00:00
parent f876f0659f
commit c2a737ab84
3 changed files with 7 additions and 4 deletions

View File

@ -383,6 +383,7 @@ async def check_transaction_status(
def fee_reserve(amount_msat: int) -> int:
return max(int(RESERVE_FEE_MIN), int(amount_msat * RESERVE_FEE_PERCENT / 100.0))
class websocketConnectionManager:
def __init__(self):
self.active_connections: List[WebSocket] = []
@ -400,7 +401,9 @@ class websocketConnectionManager:
if connection.id == item_id:
await connection.send_text(message)
websocketManager = websocketConnectionManager()
async def websocketUpdater(item_id, data):
return await websocketManager.send_data(f"{data}", item_id)
return await websocketManager.send_data(f"{data}", item_id)

View File

@ -90,4 +90,4 @@ async def mark_webhook_sent(payment: Payment, status: int) -> None:
WHERE hash = ?
""",
(status, payment.payment_hash),
)
)

View File

@ -56,8 +56,8 @@ from ..services import (
create_invoice,
pay_invoice,
perform_lnurlauth,
websocketManager,
websocketUpdater
websocketManager,
websocketUpdater,
)
from ..tasks import api_invoice_listeners