diff --git a/electrum/plugins/trezor/trezor.py b/electrum/plugins/trezor/trezor.py index a25e98eee..cd9a884c4 100644 --- a/electrum/plugins/trezor/trezor.py +++ b/electrum/plugins/trezor/trezor.py @@ -352,7 +352,7 @@ class TrezorPlugin(HW_PluginBase): assert isinstance(tx, PartialTransaction) assert isinstance(txin, PartialTxInput) assert keystore - if txin.is_complete(): + if txin.is_complete() or not txin.is_mine: txinputtype.script_type = InputScriptType.EXTERNAL assert txin.scriptpubkey txinputtype.script_pubkey = txin.scriptpubkey diff --git a/electrum/transaction.py b/electrum/transaction.py index efb545a40..3063586a8 100644 --- a/electrum/transaction.py +++ b/electrum/transaction.py @@ -1389,6 +1389,7 @@ class PartialTxInput(TxInput, PSBTSection): self._unknown = {} # type: Dict[bytes, bytes] self._script_descriptor = None # type: Optional[Descriptor] + self.is_mine = False # type: bool # whether the wallet considers the input to be ismine self._trusted_value_sats = None # type: Optional[int] self._trusted_address = None # type: Optional[str] self._is_p2sh_segwit = None # type: Optional[bool] # None means unknown diff --git a/electrum/wallet.py b/electrum/wallet.py index ae46929e3..caa587e95 100644 --- a/electrum/wallet.py +++ b/electrum/wallet.py @@ -2443,6 +2443,7 @@ class Abstract_Wallet(ABC, Logger, EventListener): self.lnworker.swap_manager.add_txin_info(txin) return txin.script_descriptor = self.get_script_descriptor_for_address(address) + txin.is_mine = True self._add_txinout_derivation_info(txin, address, only_der_suffix=only_der_suffix) txin.block_height = self.adb.get_tx_height(txin.prevout.txid.hex()).height