improvements

This commit is contained in:
Peter D. Gray 2025-08-20 12:25:14 -04:00 committed by doc-hex
parent 6abb24443e
commit d9a601e87c
5 changed files with 10 additions and 4 deletions

View File

@ -81,7 +81,6 @@ class SpendingPolicy(dict):
# not safe to sign any txn w/ warnings: might be complaining about
# massive miner fees, or weird OP_RETURN stuff
if psbt.warnings:
print("WARN: %r" % psbt.warnings)
raise SpendPolicyViolation("has warnings")
# Magnitude: size limits for output side (non change)

View File

@ -139,6 +139,11 @@ def decode_qr_result(got, expect_secret=False, expect_text=False, expect_bbqr=Fa
elif ty in 'RSE':
# key-teleport related
from pincodes import pa
if pa.hobbled_mode and ty != 'E':
raise QRDecodeExplained("KT Blocked")
if ty == 'R' and len(got) != 33:
raise QRDecodeExplained("Truncated KT RX")

View File

@ -491,7 +491,7 @@ HobbledFileMgmtMenu = [
MenuItem('Sign Text File', f=sign_message_on_sd),
MenuItem('Batch Sign PSBT', f=batch_sign),
MenuItem('List Files', f=list_files),
MenuItem('Export Wallet', predicate=has_secrets, menu=WalletExportMenu), #dup elsewhere
MenuItem('Export Wallet', menu=WalletExportMenu), # dup under Adv/Tools
MenuItem('Verify Sig File', f=verify_sig_file),
MenuItem('NFC File Share', predicate=nfc_enabled, f=nfc_share_file, shortcut=KEY_NFC),
MenuItem('BBQr File Share', predicate=version.has_qr, f=qr_share_file, arg=True),
@ -516,7 +516,7 @@ HobbledNFCToolsMenu = [
HobbledAdvancedMenu = [
# xxxxxxxxxxxxxxxx
MenuItem("File Management", menu=HobbledFileMgmtMenu),
MenuItem('Export Wallet', predicate=has_secrets, menu=WalletExportMenu, shortcut='x'), # also inside FileMgmt
MenuItem('Export Wallet', menu=WalletExportMenu, shortcut='x'), # also inside FileMgmt
MenuItem('Teleport Multisig PSBT', predicate=qr_and_ms, f=kt_send_file_psbt),
MenuItem("View Identity", f=view_ident),
MenuItem('Paper Wallets', f=make_paper_wallet),

View File

@ -21,6 +21,8 @@ from utils import problem_file_line, url_unquote, wipe_if_deltamode
ONE_LINE = CHARS_W-2
async def make_notes_menu(*a):
from pincodes import pa
if pa.hobbled_mode:
# Read only version of menu system
# - used when spending policy in effect

View File

@ -484,7 +484,7 @@ async def kt_incoming(type_code, payload):
from pincodes import pa
if pa.hobbled_mode and type_code != 'E':
# only PSBT rx is supported in hobbled mode
# TODO: fail silently? good enough?
# fail silently, this is second check, see decoders.py
return
if type_code == 'R':