1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 07:28:10 +00:00

legacy: use cryptoMultisigPubkeyCount where possible

This commit is contained in:
Pavol Rusnak 2019-10-24 15:47:38 +02:00
parent c145db7dd2
commit 9ab1554e93
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 2 additions and 4 deletions

View File

@ -221,9 +221,7 @@ void fsm_msgGetAddress(const GetAddress *msg) {
if (msg->has_multisig) {
strlcpy(desc, "Multisig __ of __:", sizeof(desc));
const uint32_t m = msg->multisig.m;
const uint32_t n = msg->multisig.nodes_count
? msg->multisig.nodes_count
: msg->multisig.pubkeys_count;
const uint32_t n = cryptoMultisigPubkeyCount(&(msg->multisig));
desc[9] = (m < 10) ? ' ' : ('0' + (m / 10));
desc[10] = '0' + (m % 10);
desc[15] = (n < 10) ? ' ' : ('0' + (n / 10));

View File

@ -804,7 +804,7 @@ static uint32_t tx_input_script_size(const TxInputType *txinput) {
if (txinput->has_multisig) {
uint32_t multisig_script_size =
TXSIZE_MULTISIGSCRIPT +
txinput->multisig.pubkeys_count * (1 + TXSIZE_PUBKEY);
cryptoMultisigPubkeyCount(&(txinput->multisig)) * (1 + TXSIZE_PUBKEY);
input_script_size = 1 // the OP_FALSE bug in multisig
+ txinput->multisig.m * (1 + TXSIZE_SIGNATURE) +
op_push_size(multisig_script_size) +