@@ -76,7 +76,6 @@ CoinControlDialog::CoinControlDialog(const PlatformStyle *platformStyle, QWidget
76
76
QAction *clipboardFeeAction = new QAction (tr (" Copy fee" ), this );
77
77
QAction *clipboardAfterFeeAction = new QAction (tr (" Copy after fee" ), this );
78
78
QAction *clipboardBytesAction = new QAction (tr (" Copy bytes" ), this );
79
- QAction *clipboardPriorityAction = new QAction (tr (" Copy priority" ), this );
80
79
QAction *clipboardLowOutputAction = new QAction (tr (" Copy dust" ), this );
81
80
QAction *clipboardChangeAction = new QAction (tr (" Copy change" ), this );
82
81
@@ -85,7 +84,6 @@ CoinControlDialog::CoinControlDialog(const PlatformStyle *platformStyle, QWidget
85
84
connect (clipboardFeeAction, SIGNAL (triggered ()), this , SLOT (clipboardFee ()));
86
85
connect (clipboardAfterFeeAction, SIGNAL (triggered ()), this , SLOT (clipboardAfterFee ()));
87
86
connect (clipboardBytesAction, SIGNAL (triggered ()), this , SLOT (clipboardBytes ()));
88
- connect (clipboardPriorityAction, SIGNAL (triggered ()), this , SLOT (clipboardPriority ()));
89
87
connect (clipboardLowOutputAction, SIGNAL (triggered ()), this , SLOT (clipboardLowOutput ()));
90
88
connect (clipboardChangeAction, SIGNAL (triggered ()), this , SLOT (clipboardChange ()));
91
89
@@ -94,7 +92,6 @@ CoinControlDialog::CoinControlDialog(const PlatformStyle *platformStyle, QWidget
94
92
ui->labelCoinControlFee ->addAction (clipboardFeeAction);
95
93
ui->labelCoinControlAfterFee ->addAction (clipboardAfterFeeAction);
96
94
ui->labelCoinControlBytes ->addAction (clipboardBytesAction);
97
- ui->labelCoinControlPriority ->addAction (clipboardPriorityAction);
98
95
ui->labelCoinControlLowOutput ->addAction (clipboardLowOutputAction);
99
96
ui->labelCoinControlChange ->addAction (clipboardChangeAction);
100
97
@@ -124,16 +121,14 @@ CoinControlDialog::CoinControlDialog(const PlatformStyle *platformStyle, QWidget
124
121
ui->treeWidget ->headerItem ()->setText (COLUMN_CHECKBOX, QString ());
125
122
126
123
ui->treeWidget ->setColumnWidth (COLUMN_CHECKBOX, 84 );
127
- ui->treeWidget ->setColumnWidth (COLUMN_AMOUNT, 100 );
128
- ui->treeWidget ->setColumnWidth (COLUMN_LABEL, 170 );
129
- ui->treeWidget ->setColumnWidth (COLUMN_ADDRESS, 290 );
130
- ui->treeWidget ->setColumnWidth (COLUMN_DATE, 110 );
131
- ui->treeWidget ->setColumnWidth (COLUMN_CONFIRMATIONS, 100 );
132
- ui->treeWidget ->setColumnWidth (COLUMN_PRIORITY, 100 );
124
+ ui->treeWidget ->setColumnWidth (COLUMN_AMOUNT, 110 );
125
+ ui->treeWidget ->setColumnWidth (COLUMN_LABEL, 190 );
126
+ ui->treeWidget ->setColumnWidth (COLUMN_ADDRESS, 320 );
127
+ ui->treeWidget ->setColumnWidth (COLUMN_DATE, 130 );
128
+ ui->treeWidget ->setColumnWidth (COLUMN_CONFIRMATIONS, 110 );
133
129
ui->treeWidget ->setColumnHidden (COLUMN_TXHASH, true ); // store transaction hash in this column, but don't show it
134
130
ui->treeWidget ->setColumnHidden (COLUMN_VOUT_INDEX, true ); // store vout index in this column, but don't show it
135
131
ui->treeWidget ->setColumnHidden (COLUMN_AMOUNT_INT64, true ); // store amount int64 in this column, but don't show it
136
- ui->treeWidget ->setColumnHidden (COLUMN_PRIORITY_INT64, true ); // store priority int64 in this column, but don't show it
137
132
ui->treeWidget ->setColumnHidden (COLUMN_DATE_INT64, true ); // store date int64 in this column, but don't show it
138
133
139
134
// default view is sorted by amount desc
@@ -325,12 +320,6 @@ void CoinControlDialog::clipboardBytes()
325
320
GUIUtil::setClipboard (ui->labelCoinControlBytes ->text ().replace (ASYMP_UTF8, " " ));
326
321
}
327
322
328
- // copy label "Priority" to clipboard
329
- void CoinControlDialog::clipboardPriority ()
330
- {
331
- GUIUtil::setClipboard (ui->labelCoinControlPriority ->text ());
332
- }
333
-
334
323
// copy label "Dust" to clipboard
335
324
void CoinControlDialog::clipboardLowOutput ()
336
325
{
@@ -419,25 +408,6 @@ void CoinControlDialog::viewItemChanged(QTreeWidgetItem* item, int column)
419
408
#endif
420
409
}
421
410
422
- // return human readable label for priority number
423
- QString CoinControlDialog::getPriorityLabel (double dPriority, double mempoolEstimatePriority)
424
- {
425
- double dPriorityMedium = mempoolEstimatePriority;
426
-
427
- if (dPriorityMedium <= 0 )
428
- dPriorityMedium = AllowFreeThreshold (); // not enough data, back to hard-coded
429
-
430
- if (dPriority / 1000000 > dPriorityMedium) return tr (" highest" );
431
- else if (dPriority / 100000 > dPriorityMedium) return tr (" higher" );
432
- else if (dPriority / 10000 > dPriorityMedium) return tr (" high" );
433
- else if (dPriority / 1000 > dPriorityMedium) return tr (" medium-high" );
434
- else if (dPriority > dPriorityMedium) return tr (" medium" );
435
- else if (dPriority * 10 > dPriorityMedium) return tr (" low-medium" );
436
- else if (dPriority * 100 > dPriorityMedium) return tr (" low" );
437
- else if (dPriority * 1000 > dPriorityMedium) return tr (" lower" );
438
- else return tr (" lowest" );
439
- }
440
-
441
411
// shows count of locked unspent outputs
442
412
void CoinControlDialog::updateLabelLocked ()
443
413
{
@@ -473,7 +443,6 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
473
443
}
474
444
}
475
445
476
- QString sPriorityLabel = tr (" none" );
477
446
CAmount nAmount = 0 ;
478
447
CAmount nPayFee = 0 ;
479
448
CAmount nAfterFee = 0 ;
@@ -551,11 +520,6 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
551
520
nBytes += nQuantity; // account for the witness byte that holds the number of stack items for each input.
552
521
}
553
522
554
- // Priority
555
- double mempoolEstimatePriority = mempool.estimateSmartPriority (nTxConfirmTarget);
556
- 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)
557
- sPriorityLabel = CoinControlDialog::getPriorityLabel (dPriority, mempoolEstimatePriority);
558
-
559
523
// in the subtract fee from amount case, we can tell if zero change already and subtract the bytes, so that fee calculation afterwards is accurate
560
524
if (CoinControlDialog::fSubtractFeeFromAmount )
561
525
if (nAmount - nPayAmount == 0 )
@@ -568,6 +532,8 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
568
532
569
533
570
534
// Allow free? (require at least hard-coded threshold and default to that if no estimate)
535
+ double mempoolEstimatePriority = mempool.estimateSmartPriority (nTxConfirmTarget);
536
+ 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)
571
537
double dPriorityNeeded = std::max (mempoolEstimatePriority, AllowFreeThreshold ());
572
538
fAllowFree = (dPriority >= dPriorityNeeded);
573
539
@@ -617,7 +583,6 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
617
583
QLabel *l3 = dialog->findChild <QLabel *>(" labelCoinControlFee" );
618
584
QLabel *l4 = dialog->findChild <QLabel *>(" labelCoinControlAfterFee" );
619
585
QLabel *l5 = dialog->findChild <QLabel *>(" labelCoinControlBytes" );
620
- QLabel *l6 = dialog->findChild <QLabel *>(" labelCoinControlPriority" );
621
586
QLabel *l7 = dialog->findChild <QLabel *>(" labelCoinControlLowOutput" );
622
587
QLabel *l8 = dialog->findChild <QLabel *>(" labelCoinControlChange" );
623
588
@@ -633,7 +598,6 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
633
598
l3->setText (BitcoinUnits::formatWithUnit (nDisplayUnit, nPayFee)); // Fee
634
599
l4->setText (BitcoinUnits::formatWithUnit (nDisplayUnit, nAfterFee)); // After Fee
635
600
l5->setText (((nBytes > 0 ) ? ASYMP_UTF8 : " " ) + QString::number (nBytes)); // Bytes
636
- l6->setText (sPriorityLabel ); // Priority
637
601
l7->setText (fDust ? tr (" yes" ) : tr (" no" )); // Dust
638
602
l8->setText (BitcoinUnits::formatWithUnit (nDisplayUnit, nChange)); // Change
639
603
if (nPayFee > 0 && (coinControl->nMinimumTotalFee < nPayFee))
@@ -644,21 +608,11 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
644
608
l8->setText (ASYMP_UTF8 + l8->text ());
645
609
}
646
610
647
- // turn labels "red"
648
- l5->setStyleSheet ((nBytes >= MAX_FREE_TRANSACTION_CREATE_SIZE) ? " color:red;" : " " );// Bytes >= 1000
649
- l6->setStyleSheet ((dPriority > 0 && !fAllowFree ) ? " color:red;" : " " ); // Priority < "medium"
650
- l7->setStyleSheet ((fDust ) ? " color:red;" : " " ); // Dust = "yes"
611
+ // turn label red when dust
612
+ l7->setStyleSheet ((fDust ) ? " color:red;" : " " );
651
613
652
614
// tool tips
653
- QString toolTip1 = tr (" This label turns red if the transaction size is greater than 1000 bytes." ) + " <br /><br />" ;
654
- toolTip1 += tr (" This means a fee of at least %1 per kB is required." ).arg (BitcoinUnits::formatHtmlWithUnit (nDisplayUnit, CWallet::GetRequiredFee (1000 ))) + " <br /><br />" ;
655
- toolTip1 += tr (" Can vary +/- 1 byte per input." );
656
-
657
- QString toolTip2 = tr (" Transactions with higher priority are more likely to get included into a block." ) + " <br /><br />" ;
658
- toolTip2 += tr (" This label turns red if the priority is smaller than \" medium\" ." ) + " <br /><br />" ;
659
- toolTip2 += tr (" This means a fee of at least %1 per kB is required." ).arg (BitcoinUnits::formatHtmlWithUnit (nDisplayUnit, CWallet::GetRequiredFee (1000 )));
660
-
661
- QString toolTip3 = tr (" This label turns red if any recipient receives an amount smaller than the current dust threshold." );
615
+ QString toolTipDust = tr (" This label turns red if any recipient receives an amount smaller than the current dust threshold." );
662
616
663
617
// how many satoshis the estimated fee can vary per byte we guess wrong
664
618
double dFeeVary;
@@ -671,14 +625,11 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
671
625
672
626
l3->setToolTip (toolTip4);
673
627
l4->setToolTip (toolTip4);
674
- l5->setToolTip (toolTip1);
675
- l6->setToolTip (toolTip2);
676
- l7->setToolTip (toolTip3);
628
+ l7->setToolTip (toolTipDust);
677
629
l8->setToolTip (toolTip4);
678
630
dialog->findChild <QLabel *>(" labelCoinControlFeeText" ) ->setToolTip (l3->toolTip ());
679
631
dialog->findChild <QLabel *>(" labelCoinControlAfterFeeText" ) ->setToolTip (l4->toolTip ());
680
632
dialog->findChild <QLabel *>(" labelCoinControlBytesText" ) ->setToolTip (l5->toolTip ());
681
- dialog->findChild <QLabel *>(" labelCoinControlPriorityText" ) ->setToolTip (l6->toolTip ());
682
633
dialog->findChild <QLabel *>(" labelCoinControlLowOutputText" )->setToolTip (l7->toolTip ());
683
634
dialog->findChild <QLabel *>(" labelCoinControlChangeText" ) ->setToolTip (l8->toolTip ());
684
635
@@ -702,7 +653,6 @@ void CoinControlDialog::updateView()
702
653
QFlags<Qt::ItemFlag> flgTristate = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsTristate;
703
654
704
655
int nDisplayUnit = model->getOptionsModel ()->getDisplayUnit ();
705
- double mempoolEstimatePriority = mempool.estimateSmartPriority (nTxConfirmTarget);
706
656
707
657
std::map<QString, std::vector<COutput> > mapCoins;
708
658
model->listCoins (mapCoins);
@@ -731,11 +681,8 @@ void CoinControlDialog::updateView()
731
681
}
732
682
733
683
CAmount nSum = 0 ;
734
- double dPrioritySum = 0 ;
735
684
int nChildren = 0 ;
736
- int nInputSum = 0 ;
737
685
BOOST_FOREACH (const COutput& out, coins.second ) {
738
- int nInputSize = 0 ;
739
686
nSum += out.tx ->vout [out.i ].nValue ;
740
687
nChildren++;
741
688
@@ -755,11 +702,6 @@ void CoinControlDialog::updateView()
755
702
// if listMode or change => show bitcoin address. In tree mode, address is not shown again for direct wallet address outputs
756
703
if (!treeMode || (!(sAddress == sWalletAddress )))
757
704
itemOutput->setText (COLUMN_ADDRESS, sAddress );
758
-
759
- CPubKey pubkey;
760
- CKeyID *keyid = boost::get<CKeyID>(&outputAddress);
761
- if (keyid && model->getPubKey (*keyid, pubkey) && !pubkey.IsCompressed ())
762
- nInputSize = 29 ; // 29 = 180 - 151 (public key is 180 bytes, priority free area is 151 bytes)
763
705
}
764
706
765
707
// label
@@ -788,13 +730,6 @@ void CoinControlDialog::updateView()
788
730
// confirmations
789
731
itemOutput->setText (COLUMN_CONFIRMATIONS, strPad (QString::number (out.nDepth ), 8 , " " ));
790
732
791
- // priority
792
- double dPriority = ((double )out.tx ->vout [out.i ].nValue / (nInputSize + 78 )) * (out.nDepth +1 ); // 78 = 2 * 34 + 10
793
- itemOutput->setText (COLUMN_PRIORITY, CoinControlDialog::getPriorityLabel (dPriority, mempoolEstimatePriority));
794
- itemOutput->setText (COLUMN_PRIORITY_INT64, strPad (QString::number ((int64_t )dPriority), 20 , " " ));
795
- dPrioritySum += (double )out.tx ->vout [out.i ].nValue * (out.nDepth +1 );
796
- nInputSum += nInputSize;
797
-
798
733
// transaction hash
799
734
uint256 txhash = out.tx ->GetHash ();
800
735
itemOutput->setText (COLUMN_TXHASH, QString::fromStdString (txhash.GetHex ()));
@@ -819,12 +754,9 @@ void CoinControlDialog::updateView()
819
754
// amount
820
755
if (treeMode)
821
756
{
822
- dPrioritySum = dPrioritySum / (nInputSum + 78 );
823
757
itemWalletAddress->setText (COLUMN_CHECKBOX, " (" + QString::number (nChildren) + " )" );
824
758
itemWalletAddress->setText (COLUMN_AMOUNT, BitcoinUnits::format (nDisplayUnit, nSum));
825
759
itemWalletAddress->setText (COLUMN_AMOUNT_INT64, strPad (QString::number (nSum), 15 , " " ));
826
- itemWalletAddress->setText (COLUMN_PRIORITY, CoinControlDialog::getPriorityLabel (dPrioritySum, mempoolEstimatePriority));
827
- itemWalletAddress->setText (COLUMN_PRIORITY_INT64, strPad (QString::number ((int64_t )dPrioritySum), 20 , " " ));
828
760
}
829
761
}
830
762
0 commit comments