mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2025-11-05 11:56:37 +00:00
increase recent blocks estimated fee rate update frequency
This commit is contained in:
parent
63c0a6d6e2
commit
098afebbe0
2 changed files with 9 additions and 0 deletions
|
|
@ -17,8 +17,10 @@ import javafx.util.Duration;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.sparrowwallet.sparrow.AppServices.TARGET_BLOCKS_RANGE;
|
||||
import static com.sparrowwallet.sparrow.control.BlockCube.CUBE_SIZE;
|
||||
|
||||
public class RecentBlocksView extends Pane {
|
||||
|
|
@ -136,6 +138,12 @@ public class RecentBlocksView extends Pane {
|
|||
}
|
||||
}
|
||||
|
||||
public void updateFeeRate(Map<Integer, Double> targetBlockFeeRates) {
|
||||
int defaultTarget = TARGET_BLOCKS_RANGE.get((TARGET_BLOCKS_RANGE.size() / 2) - 1);
|
||||
Double defaultRate = targetBlockFeeRates.get(defaultTarget);
|
||||
updateFeeRate(defaultRate);
|
||||
}
|
||||
|
||||
public void updateFeeRate(Double currentFeeRate) {
|
||||
if(!getCubes().isEmpty()) {
|
||||
BlockCube firstCube = getCubes().getFirst();
|
||||
|
|
|
|||
|
|
@ -1411,6 +1411,7 @@ public class SendController extends WalletFormController implements Initializabl
|
|||
setFeeRatePriority(getFeeRangeRate());
|
||||
}
|
||||
feeRange.updateTrackHighlight();
|
||||
recentBlocksView.updateFeeRate(event.getTargetBlockFeeRates());
|
||||
|
||||
if(updateDefaultFeeRate) {
|
||||
if(getFeeRate() != null && Long.valueOf((long)getFallbackFeeRate()).equals(getFeeRate().longValue())) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue