Browse Source

lnbase: print exceptions from main_loop

dependabot/pip/contrib/deterministic-build/ecdsa-0.13.3
Janus 7 years ago
committed by ThomasV
parent
commit
e906e6e90a
  1. 4
      lib/lnbase.py

4
lib/lnbase.py

@ -4,6 +4,7 @@
Derived from https://gist.github.com/AdamISZ/046d05c156aaeb56cc897f85eecb3eb8
"""
import traceback
import itertools
import json
from collections import OrderedDict
@ -332,6 +333,7 @@ class Peer(PrintError):
# self.send_message(gen_msg('open_channel', funding_satoshis=funding_sat, push_msat=push_msat))
async def main_loop(self):
try:
self.reader, self.writer = await asyncio.open_connection(self.host, self.port)
await self.handshake()
# send init
@ -346,6 +348,8 @@ class Peer(PrintError):
self.ping_if_required()
msg = await self.read_message()
self.process_message(msg)
except:
traceback.print_exc()
# close socket
self.print_error('closing lnbase')
self.writer.close()

Loading…
Cancel
Save