Skip to content

Commit

Permalink
Improve block % and fee display
Browse files Browse the repository at this point in the history
  • Loading branch information
chimp1984 committed Nov 26, 2020
1 parent 99a076d commit d60a2dd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
8 changes: 4 additions & 4 deletions core/src/main/java/bisq/core/app/WalletAppSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ void init(@Nullable Consumer<String> chainFileLockedExceptionHandler,
String result;
if (exception == null) {
double percentage = (double) downloadPercentage;
String fees = feeService.getFeeTextForDisplay();
btcSyncProgress.set(percentage);
int bestChainHeight = walletsSetup.getChain() != null ?
walletsSetup.getChain().getBestChainHeight() :
Expand All @@ -129,10 +128,11 @@ void init(@Nullable Consumer<String> chainFileLockedExceptionHandler,
if (percentage == 1) {
String synchronizedWith = Res.get("mainView.footer.btcInfo.synchronizedWith",
getBtcNetworkAsString(), chainHeightAsString);
result = Res.get("mainView.footer.btcInfo", synchronizedWith,
feeService.getFeeTextForDisplay());
String info = feeService.isFeeAvailable() ?
Res.get("mainView.footer.btcFeeRate", feeService.getTxFeePerVbyte().value) :
"";
result = Res.get("mainView.footer.btcInfo", synchronizedWith, info);
getBtcSplashSyncIconId().set("image-connection-synced");

downloadCompleteHandler.run();
} else if (percentage > 0.0) {
String synchronizingWith = Res.get("mainView.footer.btcInfo.synchronizingWith",
Expand Down
8 changes: 2 additions & 6 deletions core/src/main/java/bisq/core/provider/fee/FeeService.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import bisq.core.dao.governance.param.Param;
import bisq.core.dao.governance.period.PeriodService;
import bisq.core.dao.state.DaoStateService;
import bisq.core.locale.Res;

import bisq.common.UserThread;
import bisq.common.config.Config;
Expand Down Expand Up @@ -192,10 +191,7 @@ public ReadOnlyIntegerProperty feeUpdateCounterProperty() {
return feeUpdateCounter;
}

public String getFeeTextForDisplay() {
// only show the fee rate if it has been initialized from the service (see feeUpdateCounter)
if (feeUpdateCounter.get() > 0)
return Res.get("mainView.footer.btcFeeRate", txFeePerVbyte);
return "";
public boolean isFeeAvailable() {
return feeUpdateCounter.get() > 0;
}
}
10 changes: 5 additions & 5 deletions core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,14 @@ mainView.balance.locked=Locked in trades
mainView.balance.reserved.short=Reserved
mainView.balance.locked.short=Locked

mainView.footer.usingTor=(using Tor)
mainView.footer.usingTor=(via Tor)
mainView.footer.localhostBitcoinNode=(localhost)
mainView.footer.btcInfo={0} {1} {2}
mainView.footer.btcFeeRate=/ Current fee rate: {0} sat/vB
mainView.footer.btcInfo={0} {1}
mainView.footer.btcFeeRate=/ Fee rate: {0} sat/vB
mainView.footer.btcInfo.initializing=Connecting to Bitcoin network
mainView.footer.bsqInfo.synchronizing=/ Synchronizing DAO
mainView.footer.btcInfo.synchronizingWith=Synchronizing with {0} at block: {1} ({2})
mainView.footer.btcInfo.synchronizedWith=Synced with {0} at block {1} /
mainView.footer.btcInfo.synchronizingWith=Synchronizing with {0} at block: {1} / {2}
mainView.footer.btcInfo.synchronizedWith=Synced with {0} at block {1}
mainView.footer.btcInfo.connectingTo=Connecting to
mainView.footer.btcInfo.connectionFailed=Connection failed to
mainView.footer.p2pInfo=Bitcoin network peers: {0} / Bisq network peers: {1}
Expand Down

0 comments on commit d60a2dd

Please sign in to comment.