Browse Source

trezor: only TYPE_ADDRESS is needed for non-change outputs

seed_v14
ThomasV 7 years ago
parent
commit
020f0637d7
  1. 11
      plugins/trezor/plugin.py

11
plugins/trezor/plugin.py

@ -356,16 +356,7 @@ class TrezorCompatiblePlugin(HW_PluginBase):
txoutputtype.script_type = self.types.PAYTOOPRETURN
txoutputtype.op_return_data = address[2:]
elif _type == TYPE_ADDRESS:
if is_segwit_address(address):
txoutputtype.script_type = self.types.PAYTOWITNESS
else:
addrtype, hash_160 = b58_address_to_hash160(address)
if addrtype == ADDRTYPE_P2PKH:
txoutputtype.script_type = self.types.PAYTOADDRESS
elif addrtype == ADDRTYPE_P2SH:
txoutputtype.script_type = self.types.PAYTOSCRIPTHASH
else:
raise BaseException('addrtype')
txoutputtype.script_type = self.types.PAYTOADDRESS
txoutputtype.address = address
outputs.append(txoutputtype)

Loading…
Cancel
Save