Skip to content

Commit

Permalink
add try except block around displayQRCode (because of out of memory i…
Browse files Browse the repository at this point in the history
…ssues with large QRs)
  • Loading branch information
tadeubas committed Oct 24, 2023
1 parent ad20ed8 commit b531b3f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/krux/pages/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b531b3f

Please sign in to comment.