fix prevtx hashing when input count is 0

pull/25/head
Pavol Rusnak 8 years ago
parent 2daab8cf02
commit e9f0706c2e
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -334,7 +334,12 @@ void signing_txack(TransactionType *tx)
tx_init(&tp, tx->inputs_cnt, tx->outputs_cnt, tx->version, tx->lock_time, tx->extra_data_len, false);
progress_meta_step = progress_step / (tp.inputs_len + tp.outputs_len);
idx2 = 0;
send_req_2_prev_input();
if (tp.inputs_len > 0) {
send_req_2_prev_input();
} else {
tx_serialize_header_hash(&tp);
send_req_2_prev_output();
}
return;
case STAGE_REQUEST_2_PREV_INPUT:
progress = (idx1 * progress_step + idx2 * progress_meta_step) >> PROGRESS_PRECISION;

@ -55,6 +55,7 @@ uint32_t tx_serialize_input(TxStruct *tx, const TxInputType *input, uint8_t *out
uint32_t tx_serialize_output(TxStruct *tx, const TxOutputBinType *output, uint8_t *out);
void tx_init(TxStruct *tx, uint32_t inputs_len, uint32_t outputs_len, uint32_t version, uint32_t lock_time, uint32_t extra_data_len, bool add_hash_type);
uint32_t tx_serialize_header_hash(TxStruct *tx);
uint32_t tx_serialize_input_hash(TxStruct *tx, const TxInputType *input);
uint32_t tx_serialize_output_hash(TxStruct *tx, const TxOutputBinType *output);
uint32_t tx_serialize_extra_data_hash(TxStruct *tx, const uint8_t *data, uint32_t datalen);

Loading…
Cancel
Save