mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-02 20:36:44 +00:00
follow up
This commit is contained in:
parent
1497b3d3bb
commit
26c177bd00
4 changed files with 14 additions and 9 deletions
|
@ -139,7 +139,7 @@ public class WhirlpoolController {
|
|||
tx0Previews = null;
|
||||
tx0PreviewProperty.set(null);
|
||||
Tx0FeeTarget tx0FeeTarget = FEE_TARGETS.get(newValue.intValue());
|
||||
premixFeeRate.setText(SparrowMinerFeeSupplier.getMinimumFeeForTarget(Integer.parseInt(tx0FeeTarget.getFeeTarget().getValue())) + " sats/vB");
|
||||
premixFeeRate.setText(SparrowMinerFeeSupplier.getFee(Integer.parseInt(tx0FeeTarget.getFeeTarget().getValue())) + " sats/vB");
|
||||
});
|
||||
premixPriority.setValue(1);
|
||||
|
||||
|
|
|
@ -26,13 +26,18 @@ public class SparrowMinerFeeSupplier implements MinerFeeSupplier {
|
|||
|
||||
@Override
|
||||
public int getFee(MinerFeeTarget feeTarget) {
|
||||
return getFee(Integer.parseInt(feeTarget.getValue()));
|
||||
}
|
||||
|
||||
public static int getFee(int targetBlocks) {
|
||||
if(AppServices.getTargetBlockFeeRates() == null) {
|
||||
return FALLBACK_FEE_RATE;
|
||||
}
|
||||
return getMinimumFeeForTarget(Integer.parseInt(feeTarget.getValue()));
|
||||
|
||||
return getMinimumFeeForTarget(targetBlocks);
|
||||
}
|
||||
|
||||
public static Integer getMinimumFeeForTarget(int targetBlocks) {
|
||||
private static Integer getMinimumFeeForTarget(int targetBlocks) {
|
||||
List<Map.Entry<Integer, Double>> feeRates = new ArrayList<>(AppServices.getTargetBlockFeeRates().entrySet());
|
||||
Collections.reverse(feeRates);
|
||||
for(Map.Entry<Integer, Double> feeRate : feeRates) {
|
||||
|
|
|
@ -38,9 +38,9 @@
|
|||
}
|
||||
|
||||
.field-label {
|
||||
-fx-pref-width: 120px;
|
||||
-fx-pref-width: 130px;
|
||||
}
|
||||
|
||||
.field-control {
|
||||
-fx-pref-width: 160px;
|
||||
-fx-pref-width: 180px;
|
||||
}
|
|
@ -92,7 +92,7 @@
|
|||
<Insets top="20" />
|
||||
</padding>
|
||||
<Label text="SCODE:" styleClass="field-label" />
|
||||
<TextField fx:id="scode" />
|
||||
<TextField fx:id="scode" styleClass="field-control"/>
|
||||
</HBox>
|
||||
<HBox styleClass="field-box">
|
||||
<padding>
|
||||
|
|
Loading…
Reference in a new issue