1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-29 19:08:12 +00:00

coins: Add force_bip143

This commit is contained in:
Saleem Rashid 2017-10-31 20:55:15 +00:00 committed by Pavol Rusnak
parent b6f11c9f93
commit c6246b5fba
3 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,7 @@ def get_fields(coin):
'true' if coin['address_type_p2sh'] is not None else 'false', 'true' if coin['address_type_p2sh'] is not None else 'false',
'true' if coin['segwit'] else 'false', 'true' if coin['segwit'] else 'false',
'true' if coin['forkid'] is not None else 'false', 'true' if coin['forkid'] is not None else 'false',
'true' if coin['force_bip143'] else 'false',
'%d' % coin['address_type'] if coin['address_type'] is not None else '0', '%d' % coin['address_type'] if coin['address_type'] is not None else '0',
'%d' % coin['address_type_p2sh'] if coin['address_type_p2sh'] is not None else '0', '%d' % coin['address_type_p2sh'] if coin['address_type_p2sh'] is not None else '0',
'0x%s' % coin['xpub_magic'] if coin['xpub_magic'] is not None else '0x00000000', '0x%s' % coin['xpub_magic'] if coin['xpub_magic'] is not None else '0x00000000',

View File

@ -34,6 +34,7 @@ typedef struct _CoinInfo {
bool has_address_type_p2sh; bool has_address_type_p2sh;
bool has_segwit; bool has_segwit;
bool has_forkid; bool has_forkid;
bool force_bip143;
// address types > 0xFF represent a two-byte prefix in big-endian order // address types > 0xFF represent a two-byte prefix in big-endian order
uint32_t address_type; uint32_t address_type;
uint32_t address_type_p2sh; uint32_t address_type_p2sh;

View File

@ -258,6 +258,8 @@ void fsm_msgGetFeatures(GetFeatures *msg)
resp->coins[i].segwit = coins[i].has_segwit; resp->coins[i].segwit = coins[i].has_segwit;
resp->coins[i].has_forkid = coins[i].has_forkid; resp->coins[i].has_forkid = coins[i].has_forkid;
resp->coins[i].forkid = coins[i].forkid; resp->coins[i].forkid = coins[i].forkid;
resp->coins[i].has_force_bip143 = true;
resp->coins[i].force_bip143 = coins[i].force_bip143;
} }
resp->has_initialized = true; resp->initialized = storage_isInitialized(); resp->has_initialized = true; resp->initialized = storage_isInitialized();
resp->has_imported = true; resp->imported = storage.has_imported && storage.imported; resp->has_imported = true; resp->imported = storage.has_imported && storage.imported;