mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-03 03:50:58 +00:00
core, legacy: make sure OPRETURN ouput is not marked as change
This commit is contained in:
parent
a513f7429b
commit
0903159d9b
@ -790,6 +790,13 @@ def output_is_change(
|
|||||||
segwit_in: int,
|
segwit_in: int,
|
||||||
multifp: multisig.MultisigFingerprint,
|
multifp: multisig.MultisigFingerprint,
|
||||||
) -> bool:
|
) -> bool:
|
||||||
|
if o.script_type not in (
|
||||||
|
OutputScriptType.PAYTOADDRESS,
|
||||||
|
OutputScriptType.PAYTOMULTISIG,
|
||||||
|
OutputScriptType.PAYTOWITNESS,
|
||||||
|
OutputScriptType.PAYTOP2SHWITNESS,
|
||||||
|
):
|
||||||
|
return False
|
||||||
if o.multisig and not multifp.matches(o.multisig):
|
if o.multisig and not multifp.matches(o.multisig):
|
||||||
return False
|
return False
|
||||||
if output_is_segwit(o) and o.amount > segwit_in:
|
if output_is_segwit(o) and o.amount > segwit_in:
|
||||||
|
@ -696,6 +696,13 @@ static bool signing_check_output(TxOutputType *txoutput) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((txoutput->script_type != OutputScriptType_PAYTOADDRESS) &&
|
||||||
|
(txoutput->script_type != OutputScriptType_PAYTOMULTISIG) &&
|
||||||
|
(txoutput->script_type != OutputScriptType_PAYTOWITNESS) &&
|
||||||
|
(txoutput->script_type != OutputScriptType_PAYTOP2SHWITNESS)) {
|
||||||
|
is_change = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (is_change) {
|
if (is_change) {
|
||||||
if (change_spend == 0) { // not set
|
if (change_spend == 0) { // not set
|
||||||
change_spend = txoutput->amount;
|
change_spend = txoutput->amount;
|
||||||
|
Loading…
Reference in New Issue
Block a user