mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-08-10 00:27:00 +00:00
follow up
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
+10
-5
@@ -26,13 +26,18 @@ public class SparrowMinerFeeSupplier implements MinerFeeSupplier {
|
||||
|
||||
@Override
|
||||
public int getFee(MinerFeeTarget feeTarget) {
|
||||
if (AppServices.getTargetBlockFeeRates() == null) {
|
||||
return FALLBACK_FEE_RATE;
|
||||
}
|
||||
return getMinimumFeeForTarget(Integer.parseInt(feeTarget.getValue()));
|
||||
return getFee(Integer.parseInt(feeTarget.getValue()));
|
||||
}
|
||||
|
||||
public static Integer getMinimumFeeForTarget(int targetBlocks) {
|
||||
public static int getFee(int targetBlocks) {
|
||||
if(AppServices.getTargetBlockFeeRates() == null) {
|
||||
return FALLBACK_FEE_RATE;
|
||||
}
|
||||
|
||||
return getMinimumFeeForTarget(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) {
|
||||
|
||||
Reference in New Issue
Block a user