1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-18 21:48:13 +00:00

fix(core): No need to derive script_pubkey for external inputs.

This commit is contained in:
Andrew Kozlik 2022-10-19 19:04:14 +02:00 committed by Andrew Kozlik
parent b3a383efac
commit d2df761067

View File

@ -175,7 +175,7 @@ class Bitcoin:
if txi.witness or txi.script_sig:
self.presigned.add(i)
writers.write_tx_input_check(h_presigned_inputs_check, txi)
await self.process_external_input(txi, script_pubkey)
await self.process_external_input(txi)
else:
node = self.keychain.derive(txi.address_n)
await self.process_internal_input(txi, node)
@ -333,13 +333,15 @@ class Bitcoin:
await self.approver.add_internal_input(txi)
async def process_external_input(self, txi: TxInput, script_pubkey: bytes) -> None:
async def process_external_input(self, txi: TxInput) -> None:
assert txi.script_pubkey is not None # checked in sanitize_tx_input
self.approver.add_external_input(txi)
if txi.ownership_proof:
if not verify_nonownership(
txi.ownership_proof,
script_pubkey,
txi.script_pubkey,
txi.commitment_data,
self.keychain,
self.coin,