From fcd848d821eefff95cd7bce31d421c17a43dd4bc Mon Sep 17 00:00:00 2001 From: "Peter D. Gray" Date: Mon, 29 Sep 2025 17:19:44 -0400 Subject: [PATCH] deltamode timing fix --- shared/psbt.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/shared/psbt.py b/shared/psbt.py index daba9f22..27d10101 100644 --- a/shared/psbt.py +++ b/shared/psbt.py @@ -2045,19 +2045,19 @@ class psbtObject(psbtProxy): # track wallet usage OWNERSHIP.note_subpath_used(inp.subpaths[which_key]) + if not inp.is_segwit: + # Hash by serializing/blanking various subparts of the transaction + digest = self.make_txn_sighash(in_idx, txi, inp.sighash) + else: + # Hash the inputs and such in totally new ways, based on BIP-143 + digest = self.make_txn_segwit_sighash(in_idx, txi, + inp.amount, inp.scriptCode, inp.sighash) + if sv.deltamode: # Current user is actually a thug with a slightly wrong PIN, so we # do have access to the private keys and could sign txn, but we # are going to silently corrupt our signatures. - digest = bytes(range(32)) - else: - if not inp.is_segwit: - # Hash by serializing/blanking various subparts of the transaction - digest = self.make_txn_sighash(in_idx, txi, inp.sighash) - else: - # Hash the inputs and such in totally new ways, based on BIP-143 - digest = self.make_txn_segwit_sighash(in_idx, txi, - inp.amount, inp.scriptCode, inp.sighash) + digest = ngu.hash.sha256d(digest) # The precious private key we need pk = node.privkey()