diff --git a/lnd.py b/lnd.py index 2d5b65f..b76ce5c 100644 --- a/lnd.py +++ b/lnd.py @@ -140,7 +140,7 @@ def get_route( def get_edge(self, channel_id): try: return self.stub.GetChanInfo(ln.ChanInfoRequest(chan_id=channel_id)) - except: + except Exception: print(f"Unable to find channel edge {channel_id}") raise diff --git a/routes.py b/routes.py index b5b4c80..3bb2b36 100644 --- a/routes.py +++ b/routes.py @@ -129,7 +129,10 @@ def ignore_high_fee_hops(self, route): self.ignore_hop_on_route(hop, route) def ignore_channel(self, chan_id): - edge = self.lnd.get_edge(chan_id) + try: + edge = self.lnd.get_edge(chan_id) + except Exception: + return self.ignore_edge_from_to(chan_id, edge.node1_pub, edge.node2_pub) self.ignore_edge_from_to(chan_id, edge.node2_pub, edge.node1_pub)