Skip to content

Commit

Permalink
legacy: replace confusing Version group ID error message
Browse files Browse the repository at this point in the history
  • Loading branch information
mmilata authored and tsusanka committed Sep 4, 2020
1 parent e9ed085 commit 047fcff
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions legacy/firmware/signing.c
Original file line number Diff line number Diff line change
Expand Up @@ -1424,14 +1424,21 @@ void signing_txack(TransactionType *tx) {
signing_abort();
return;
}
if (coin->overwintered &&
(tx->version >= 3) != (tx->has_version_group_id)) {
fsm_sendFailure(FailureType_Failure_DataError,
_("Version group ID must be set when version >= 3."));
signing_abort();
return;
}
if (!coin->overwintered) {
if (coin->overwintered) {
if (tx->version >= 3 && !tx->has_version_group_id) {
fsm_sendFailure(FailureType_Failure_DataError,
_("Version group ID must be set when version >= 3."));
signing_abort();
return;
}
if (tx->version < 3 && tx->has_version_group_id) {
fsm_sendFailure(
FailureType_Failure_DataError,
_("Version group ID must be unset when version < 3."));
signing_abort();
return;
}
} else { // !coin->overwintered
if (tx->has_version_group_id) {
fsm_sendFailure(FailureType_Failure_DataError,
_("Version group ID not enabled on this coin."));
Expand Down

0 comments on commit 047fcff

Please sign in to comment.