1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 17:38:39 +00:00

differentiate between ETH and ETC using chain_id

This commit is contained in:
Pavol Rusnak 2017-01-24 17:27:11 +01:00
parent 323e7443a4
commit 5c54edf54e
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -174,7 +174,7 @@ static void send_signature(void)
resp.has_signature_v = true;
if (chain_id) {
resp.signature_v = v + 2*chain_id + 35;
resp.signature_v = v + 2 * chain_id + 35;
} else {
resp.signature_v = v + 27;
}
@ -242,7 +242,11 @@ static void ethereumFormatAmount(bignum256 *val, char buffer[25])
// remove trailing dot.
if (value_ptr[-1] == '.')
value_ptr--;
if (chain_id == 61 || chain_id == 62) {
strcpy(value_ptr, " ETC");
} else {
strcpy(value_ptr, " ETH");
}
// value is at most 16 + 4 + 1 characters long
} else {
// value is bigger than 1e9 ETH => won't fit on display (probably won't happen unless you are Vitalik)