mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-26 15:20:58 +00:00
signing: Check decred_script_version for txinput
This commit is contained in:
parent
f0875285b2
commit
0df9404054
@ -559,6 +559,12 @@ static bool signing_check_input(TxInputType *txinput) {
|
|||||||
tx_prevout_hash(&hashers[0], txinput);
|
tx_prevout_hash(&hashers[0], txinput);
|
||||||
tx_sequence_hash(&hashers[1], txinput);
|
tx_sequence_hash(&hashers[1], txinput);
|
||||||
if (coin->decred) {
|
if (coin->decred) {
|
||||||
|
if (txinput->decred_script_version > 0) {
|
||||||
|
fsm_sendFailure(FailureType_Failure_DataError, _("Decred v1+ scripts are not supported"));
|
||||||
|
signing_abort();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// serialize Decred prefix in Phase 1
|
// serialize Decred prefix in Phase 1
|
||||||
resp.has_serialized = true;
|
resp.has_serialized = true;
|
||||||
resp.serialized.has_serialized_tx = true;
|
resp.serialized.has_serialized_tx = true;
|
||||||
@ -1037,6 +1043,11 @@ void signing_txack(TransactionType *tx)
|
|||||||
signing_abort();
|
signing_abort();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (coin->decred && tx->bin_outputs[0].decred_script_version > 0) {
|
||||||
|
fsm_sendFailure(FailureType_Failure_DataError, _("Decred script version does not match previous output"));
|
||||||
|
signing_abort();
|
||||||
|
return;
|
||||||
|
}
|
||||||
to_spend += tx->bin_outputs[0].amount;
|
to_spend += tx->bin_outputs[0].amount;
|
||||||
}
|
}
|
||||||
if (idx2 < tp.outputs_len - 1) {
|
if (idx2 < tp.outputs_len - 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user