From 1985b0fa79c1cd38e407f2242a46918fa14976d6 Mon Sep 17 00:00:00 2001 From: matejcik Date: Wed, 23 Mar 2022 11:51:44 +0100 Subject: [PATCH] trezor: add support for pre-signed external inputs --- hwilib/devices/trezor.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hwilib/devices/trezor.py b/hwilib/devices/trezor.py index 68e455f91..34840cee5 100644 --- a/hwilib/devices/trezor.py +++ b/hwilib/devices/trezor.py @@ -439,6 +439,11 @@ def ignore_input() -> None: if _use_external_script_type(self.client): txinputtype.script_type = messages.InputScriptType.EXTERNAL txinputtype.script_pubkey = utxo.scriptPubKey + if psbt_in.final_script_sig: + txinputtype.script_sig = psbt_in.final_script_sig + witness = psbt_in.final_script_witness.serialize() + if witness: + txinputtype.witness = witness else: txinputtype.address_n = [0x80000000 | 84, 0x80000000 | (0 if self.chain == Chain.MAIN else 1), 0x80000000, 0, 0] txinputtype.script_type = messages.InputScriptType.SPENDWITNESS