trezor: don't try to sign non-ismine inputs
progress towards coinjoin related https://github.com/spesmilo/electrum/issues/8868
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user