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)
|
url = urllib.parse.urlsplit(self.url)
|
||||||
ws_url = f"ws://{url.netloc}/ws"
|
ws_url = f"ws://{url.netloc}/ws"
|
||||||
|
|
||||||
|
while True:
|
||||||
try:
|
try:
|
||||||
async with open_websocket_url(ws_url, extra_headers=[('Authorization', self.auth["Authorization"])]) as ws:
|
async with open_websocket_url(ws_url, extra_headers=[('Authorization', self.auth["Authorization"])]) as ws:
|
||||||
message = await ws.get_message()
|
message = await ws.get_message()
|
||||||
if message["type"] == "payment-received":
|
if "payment-received" in message["type"]:
|
||||||
print('Received message: %s' % message)
|
print('Received message: %s' % message)
|
||||||
yield message["paymentHash"]
|
yield message["paymentHash"]
|
||||||
|
|
||||||
except OSError as ose:
|
except OSError as ose:
|
||||||
|
print('OSE', ose)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
print("lost connection to eclair's websocket, retrying in 5 seconds")
|
print("lost connection to eclair's websocket, retrying in 5 seconds")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue