use estimate instead of real size of tx when calculating fee warning

pull/25/head
Pavol Rusnak 10 years ago
parent 849e758eb4
commit 9ca3854146

@ -374,8 +374,9 @@ void signing_txack(TransactionType *tx)
return;
}
uint64_t fee = to_spend - spending;
if (fee > (((uint64_t)tc.size + 999) / 1000) * coin->maxfee_kb) {
layoutFeeOverThreshold(coin, fee, ((uint64_t)tc.size + 999) / 1000);
uint32_t tx_est_size = transactionEstimateSizeKb(inputs_count, outputs_count);
if (fee > (uint64_t)tx_est_size * coin->maxfee_kb) {
layoutFeeOverThreshold(coin, fee, tx_est_size);
if (!protectButton(ButtonRequestType_ButtonRequest_FeeOverThreshold, false)) {
fsm_sendFailure(FailureType_Failure_ActionCancelled, "Fee over threshold. Signing cancelled.");
layoutHome();

@ -1 +1 @@
Subproject commit e588906f811e826c596e631d4dd2500fc38fea60
Subproject commit 3308cc62a64bac76fb475363f9bce83cab1d8381
Loading…
Cancel
Save