1
0

trezor: only TYPE_ADDRESS is needed for non-change outputs

This commit is contained in:
ThomasV
2017-10-23 14:03:43 +02:00
parent 7578ce2331
commit 020f0637d7

View File

@@ -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)