1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-16 11:28:14 +00:00

signing: add default values for branch_id (zcash)

This commit is contained in:
Pavol Rusnak 2019-02-15 01:44:10 +01:00
parent 26f9b5ba81
commit 4bc37c6b82
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -487,6 +487,17 @@ void signing_init(const SignTx *msg, const CoinInfo *_coin, const HDNode *_root)
overwintered = msg->has_overwintered && msg->overwintered;
version_group_id = msg->version_group_id;
branch_id = msg->branch_id;
// set default values for Zcash if branch_id is unset
if (overwintered && (branch_id == 0)) {
switch (version) {
case 3:
branch_id = 0x5BA81B19; // Overwinter
break;
case 4:
branch_id = 0x76B809BB; // Sapling
break;
}
}
uint32_t size = TXSIZE_HEADER + TXSIZE_FOOTER + ser_length_size(inputs_count) + ser_length_size(outputs_count);
if (coin->decred) {