@@ -538,7 +538,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
538
538
nBytes = nBytesInputs + ((CoinControlDialog::payAmounts.size () > 0 ? CoinControlDialog::payAmounts.size () + 1 : 2 ) * 34 ) + 10 ; // always assume +1 output for change here
539
539
540
540
// Priority
541
- double mempoolEstimatePriority = mempool.estimatePriority (nTxConfirmTarget);
541
+ double mempoolEstimatePriority = mempool.estimateSmartPriority (nTxConfirmTarget);
542
542
dPriority = dPriorityInputs / (nBytes - nBytesInputs + (nQuantityUncompressed * 29 )); // 29 = 180 - 151 (uncompressed public keys are over the limit. max 151 bytes of the input are ignored for priority)
543
543
sPriorityLabel = CoinControlDialog::getPriorityLabel (dPriority, mempoolEstimatePriority);
544
544
@@ -550,10 +550,8 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
550
550
// Fee
551
551
nPayFee = CWallet::GetMinimumFee (nBytes, nTxConfirmTarget, mempool);
552
552
553
- // Allow free?
554
- double dPriorityNeeded = mempoolEstimatePriority;
555
- if (dPriorityNeeded <= 0 )
556
- dPriorityNeeded = AllowFreeThreshold (); // not enough data, back to hard-coded
553
+ // Allow free? (require at least hard-coded threshold and default to that if no estimate)
554
+ double dPriorityNeeded = std::max (mempoolEstimatePriority, AllowFreeThreshold ());
557
555
fAllowFree = (dPriority >= dPriorityNeeded);
558
556
559
557
if (fSendFreeTransactions )
@@ -649,8 +647,9 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
649
647
double dFeeVary;
650
648
if (payTxFee.GetFeePerK () > 0 )
651
649
dFeeVary = (double )std::max (CWallet::GetRequiredFee (1000 ), payTxFee.GetFeePerK ()) / 1000 ;
652
- else
653
- dFeeVary = (double )std::max (CWallet::GetRequiredFee (1000 ), mempool.estimateFee (nTxConfirmTarget).GetFeePerK ()) / 1000 ;
650
+ else {
651
+ dFeeVary = (double )std::max (CWallet::GetRequiredFee (1000 ), mempool.estimateSmartFee (nTxConfirmTarget).GetFeePerK ()) / 1000 ;
652
+ }
654
653
QString toolTip4 = tr (" Can vary +/- %1 satoshi(s) per input." ).arg (dFeeVary);
655
654
656
655
l3->setToolTip (toolTip4);
@@ -686,7 +685,7 @@ void CoinControlDialog::updateView()
686
685
QFlags<Qt::ItemFlag> flgTristate = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsTristate;
687
686
688
687
int nDisplayUnit = model->getOptionsModel ()->getDisplayUnit ();
689
- double mempoolEstimatePriority = mempool.estimatePriority (nTxConfirmTarget);
688
+ double mempoolEstimatePriority = mempool.estimateSmartPriority (nTxConfirmTarget);
690
689
691
690
std::map<QString, std::vector<COutput> > mapCoins;
692
691
model->listCoins (mapCoins);
0 commit comments