From 3e5c3e1e6a5129c69f3d3b6170cec8ce506151ff Mon Sep 17 00:00:00 2001 From: tecnovert Date: Sun, 2 Jan 2022 00:04:17 +0200 Subject: [PATCH] Make errors in activateBid non fatal. --- basicswap/basicswap.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/basicswap/basicswap.py b/basicswap/basicswap.py index 73c0584..c48674a 100644 --- a/basicswap/basicswap.py +++ b/basicswap/basicswap.py @@ -899,7 +899,18 @@ class BasicSwap(BaseApp): session = scoped_session(self.session_factory) for bid in session.query(Bid): if bid.in_progress == 1 or (bid.state and bid.state > BidStates.BID_RECEIVED and bid.state < BidStates.SWAP_COMPLETED): - self.activateBid(session, bid) + try: + self.activateBid(session, bid) + except Exception as ex: + self.log.error('Failed to activate bid! Error: %s', str(ex)) + if self.debug: + self.log.error(traceback.format_exc()) + try: + self.deactivateBid(session, bid) + except Exception as ex: + self.log.error('Further error deactivating: %s', str(ex)) + if self.debug: + self.log.error(traceback.format_exc()) finally: session.close() session.remove()