From b531b3f8d37d243b40ffd3e448a17c39cdb97b19 Mon Sep 17 00:00:00 2001 From: tadeubas Date: Tue, 24 Oct 2023 18:27:57 -0300 Subject: [PATCH] add try except block around displayQRCode (because of out of memory issues with large QRs) --- src/krux/pages/home.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/krux/pages/home.py b/src/krux/pages/home.py index 526f374c0..4e9aea57b 100644 --- a/src/krux/pages/home.py +++ b/src/krux/pages/home.py @@ -482,8 +482,17 @@ def display_wallet(self, wallet, include_qr=True): self.ctx.display.clear() self.ctx.display.draw_hcentered_text(about, offset_y=DEFAULT_PADDING) self.ctx.input.wait_for_button() - wallet_data, qr_format = wallet.wallet_qr() - self.display_qr_codes(wallet_data, qr_format, title=wallet.label) + + # Try to show the wallet output descriptor as a QRCode + try: + wallet_data, qr_format = wallet.wallet_qr() + self.display_qr_codes(wallet_data, qr_format, title=wallet.label) + except Exception as e: + self.ctx.display.clear() + self.ctx.display.draw_centered_text( + t("Error:\n%s") % repr(e), theme.error_color + ) + self.ctx.input.wait_for_button() else: self.ctx.input.wait_for_button() self.ctx.display.draw_hcentered_text(about, offset_y=DEFAULT_PADDING)