set and display current monerod height instead of target

This commit is contained in:
woodser 2023-11-21 14:05:18 -05:00
parent 288b63578b
commit 846b278b5d
2 changed files with 2 additions and 4 deletions

View File

@ -558,7 +558,7 @@ public final class CoreMoneroConnectionsService {
log.debug("Polling daemon info"); log.debug("Polling daemon info");
if (daemon == null) throw new RuntimeException("No daemon connection"); if (daemon == null) throw new RuntimeException("No daemon connection");
lastInfo = daemon.getInfo(); lastInfo = daemon.getInfo();
chainHeight.set(lastInfo.getTargetHeight() == 0 ? lastInfo.getHeight() : lastInfo.getTargetHeight()); chainHeight.set(lastInfo.getHeight());
// set peer connections // set peer connections
// TODO: peers often uknown due to restricted RPC call, skipping call to get peer connections // TODO: peers often uknown due to restricted RPC call, skipping call to get peer connections

View File

@ -39,7 +39,6 @@ import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty; import javafx.beans.property.StringProperty;
import lombok.Getter; import lombok.Getter;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import monero.daemon.model.MoneroDaemonInfo;
import org.bitcoinj.core.RejectMessage; import org.bitcoinj.core.RejectMessage;
import org.bitcoinj.core.VersionMessage; import org.bitcoinj.core.VersionMessage;
@ -115,8 +114,7 @@ public class WalletAppSetup {
if (exception == null && errorMsg == null) { if (exception == null && errorMsg == null) {
double percentage = (double) downloadPercentage; double percentage = (double) downloadPercentage;
xmrSyncProgress.set(percentage); xmrSyncProgress.set(percentage);
MoneroDaemonInfo lastInfo = connectionService.getLastInfo(); Long bestChainHeight = chainHeight == null ? null : (Long) chainHeight;
Long bestChainHeight = lastInfo == null ? null : lastInfo.getHeight();
String chainHeightAsString = bestChainHeight != null && bestChainHeight > 0 ? String chainHeightAsString = bestChainHeight != null && bestChainHeight > 0 ?
String.valueOf(bestChainHeight) : String.valueOf(bestChainHeight) :
""; "";