mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-05 05:46:44 +00:00
add overpaid indicator to fee priority
This commit is contained in:
parent
c0e44b2c55
commit
ff962aa5f0
1 changed files with 13 additions and 4 deletions
|
@ -664,10 +664,19 @@ public class SendController extends WalletFormController implements Initializabl
|
||||||
|
|
||||||
if(targetBlocks != null) {
|
if(targetBlocks != null) {
|
||||||
if(targetBlocks < FeeRatesSource.BLOCKS_IN_HALF_HOUR) {
|
if(targetBlocks < FeeRatesSource.BLOCKS_IN_HALF_HOUR) {
|
||||||
|
Double maxFeeRate = FEE_RATES_RANGE.get(FEE_RATES_RANGE.size() - 1).doubleValue();
|
||||||
|
Double highestBlocksRate = targetBlocksFeeRates.get(TARGET_BLOCKS_RANGE.get(0));
|
||||||
|
if(highestBlocksRate < maxFeeRate && feeRateAmt > (highestBlocksRate + ((maxFeeRate - highestBlocksRate) / 10))) {
|
||||||
|
feeRatePriority.setText("Overpaid");
|
||||||
|
feeRatePriority.setTooltip(new Tooltip("Transaction fees at this rate are likely higher than necessary"));
|
||||||
|
feeRatePriorityGlyph.setStyle("-fx-text-fill: #c8416499");
|
||||||
|
feeRatePriorityGlyph.setIcon(FontAwesome5.Glyph.EXCLAMATION_CIRCLE);
|
||||||
|
} else {
|
||||||
feeRatePriority.setText("High Priority");
|
feeRatePriority.setText("High Priority");
|
||||||
feeRatePriority.setTooltip(new Tooltip("Typically confirms within minutes"));
|
feeRatePriority.setTooltip(new Tooltip("Typically confirms within minutes"));
|
||||||
feeRatePriorityGlyph.setStyle("-fx-text-fill: #c8416499");
|
feeRatePriorityGlyph.setStyle("-fx-text-fill: #c8416499");
|
||||||
feeRatePriorityGlyph.setIcon(FontAwesome5.Glyph.CIRCLE);
|
feeRatePriorityGlyph.setIcon(FontAwesome5.Glyph.CIRCLE);
|
||||||
|
}
|
||||||
} else if(targetBlocks < FeeRatesSource.BLOCKS_IN_HOUR) {
|
} else if(targetBlocks < FeeRatesSource.BLOCKS_IN_HOUR) {
|
||||||
feeRatePriority.setText("Medium Priority");
|
feeRatePriority.setText("Medium Priority");
|
||||||
feeRatePriority.setTooltip(new Tooltip("Typically confirms within an hour or two"));
|
feeRatePriority.setTooltip(new Tooltip("Typically confirms within an hour or two"));
|
||||||
|
|
Loading…
Reference in a new issue