Skip to content

Commit

Permalink
set and display current monerod height instead of target
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Nov 24, 2023
1 parent 288b635 commit 846b278
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ private void pollDaemonInfo() {
log.debug("Polling daemon info");
if (daemon == null) throw new RuntimeException("No daemon connection");
lastInfo = daemon.getInfo();
chainHeight.set(lastInfo.getTargetHeight() == 0 ? lastInfo.getHeight() : lastInfo.getTargetHeight());
chainHeight.set(lastInfo.getHeight());

// set peer connections
// TODO: peers often uknown due to restricted RPC call, skipping call to get peer connections
Expand Down
4 changes: 1 addition & 3 deletions core/src/main/java/haveno/core/app/WalletAppSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import javafx.beans.property.StringProperty;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import monero.daemon.model.MoneroDaemonInfo;

import org.bitcoinj.core.RejectMessage;
import org.bitcoinj.core.VersionMessage;
Expand Down Expand Up @@ -115,8 +114,7 @@ void init(@Nullable Consumer<String> chainFileLockedExceptionHandler,
if (exception == null && errorMsg == null) {
double percentage = (double) downloadPercentage;
xmrSyncProgress.set(percentage);
MoneroDaemonInfo lastInfo = connectionService.getLastInfo();
Long bestChainHeight = lastInfo == null ? null : lastInfo.getHeight();
Long bestChainHeight = chainHeight == null ? null : (Long) chainHeight;
String chainHeightAsString = bestChainHeight != null && bestChainHeight > 0 ?
String.valueOf(bestChainHeight) :
"";
Expand Down

0 comments on commit 846b278

Please sign in to comment.