mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-16 19:38:09 +00:00
signing: Use SignTx in signing_init
This commit is contained in:
parent
9849321883
commit
3f51bc3628
@ -541,7 +541,7 @@ void fsm_msgSignTx(SignTx *msg)
|
||||
const HDNode *node = fsm_getDerivedNode(coin->curve_name, NULL, 0, NULL);
|
||||
if (!node) return;
|
||||
|
||||
signing_init(msg->inputs_count, msg->outputs_count, coin, node, msg->version, msg->lock_time);
|
||||
signing_init(msg, coin, node);
|
||||
}
|
||||
|
||||
void fsm_msgTxAck(TxAck *msg)
|
||||
|
@ -430,14 +430,14 @@ bool compile_input_script_sig(TxInputType *tinput)
|
||||
return tinput->script_sig.size > 0;
|
||||
}
|
||||
|
||||
void signing_init(uint32_t _inputs_count, uint32_t _outputs_count, const CoinInfo *_coin, const HDNode *_root, uint32_t _version, uint32_t _lock_time)
|
||||
void signing_init(const SignTx *msg, const CoinInfo *_coin, const HDNode *_root)
|
||||
{
|
||||
inputs_count = _inputs_count;
|
||||
outputs_count = _outputs_count;
|
||||
inputs_count = msg->inputs_count;
|
||||
outputs_count = msg->outputs_count;
|
||||
coin = _coin;
|
||||
root = _root;
|
||||
version = _version;
|
||||
lock_time = _lock_time;
|
||||
version = msg->version;
|
||||
lock_time = msg->lock_time;
|
||||
|
||||
tx_weight = 4 * (TXSIZE_HEADER + TXSIZE_FOOTER
|
||||
+ ser_length_size(inputs_count)
|
||||
|
@ -25,9 +25,10 @@
|
||||
#include "bip32.h"
|
||||
#include "coins.h"
|
||||
#include "hasher.h"
|
||||
#include "messages.pb.h"
|
||||
#include "types.pb.h"
|
||||
|
||||
void signing_init(uint32_t _inputs_count, uint32_t _outputs_count, const CoinInfo *_coin, const HDNode *_root, uint32_t _version, uint32_t _lock_time);
|
||||
void signing_init(const SignTx *msg, const CoinInfo *_coin, const HDNode *_root);
|
||||
void signing_abort(void);
|
||||
void signing_txack(TransactionType *tx);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user