small fix on paid_invoices_stream
This commit is contained in:
parent
021cf64c1e
commit
4585d97324
1 changed files with 12 additions and 10 deletions
|
|
@ -152,14 +152,16 @@ class EclairWallet(Wallet):
|
|||
url = urllib.parse.urlsplit(self.url)
|
||||
ws_url = f"ws://{url.netloc}/ws"
|
||||
|
||||
while True:
|
||||
try:
|
||||
async with open_websocket_url(ws_url, extra_headers=[('Authorization', self.auth["Authorization"])]) as ws:
|
||||
message = await ws.get_message()
|
||||
if message["type"] == "payment-received":
|
||||
if "payment-received" in message["type"]:
|
||||
print('Received message: %s' % message)
|
||||
yield message["paymentHash"]
|
||||
|
||||
except OSError as ose:
|
||||
print('OSE', ose)
|
||||
pass
|
||||
|
||||
print("lost connection to eclair's websocket, retrying in 5 seconds")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue