Skip to content

Commit

Permalink
fixes for local monerod
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Jan 18, 2024
1 parent 947caca commit b237513
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 1 addition & 3 deletions core/src/main/java/haveno/core/api/XmrConnectionService.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import haveno.common.ThreadUtils;
import haveno.common.UserThread;
import haveno.common.app.DevEnv;
import haveno.common.config.BaseCurrencyNetwork;
import haveno.common.config.Config;
import haveno.core.trade.HavenoUtils;
import haveno.core.user.Preferences;
Expand Down Expand Up @@ -612,8 +611,7 @@ private void pollDaemonInfo() {
chainHeight.set(lastInfo.getHeight());

// update sync progress
boolean isTestnet = Config.baseCurrencyNetwork() == BaseCurrencyNetwork.XMR_LOCAL;
if (lastInfo.isSynchronized() || isTestnet) doneDownload(); // TODO: skipping synchronized check for testnet because tests cannot sync 3rd local node, see "Can manage Monero daemon connections"
if (lastInfo.isSynchronized()) doneDownload();
else if (lastInfo.isBusySyncing()) {
long targetHeight = lastInfo.getTargetHeight();
long blocksLeft = targetHeight - lastInfo.getHeight();
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/haveno/core/api/XmrLocalNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public class XmrLocalNode {
MONEROD_ARGS.add(MONEROD_PATH);
MONEROD_ARGS.add("--no-igd");
MONEROD_ARGS.add("--hide-my-port");
MONEROD_ARGS.add("--p2p-bind-ip");
MONEROD_ARGS.add(HavenoUtils.LOOPBACK_HOST);
if (!Config.baseCurrencyNetwork().isMainnet()) MONEROD_ARGS.add("--" + Config.baseCurrencyNetwork().getNetwork().toLowerCase());
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/haveno/core/xmr/XmrNodeSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static XmrNodeSettings fromProto(protobuf.XmrNodeSettings proto) {
public protobuf.XmrNodeSettings toProtoMessage() {
protobuf.XmrNodeSettings.Builder builder = protobuf.XmrNodeSettings.newBuilder();
Optional.ofNullable(blockchainPath).ifPresent(e -> builder.setBlockchainPath(blockchainPath));
Optional.ofNullable(bootstrapUrl).ifPresent(e -> builder.setBlockchainPath(bootstrapUrl));
Optional.ofNullable(bootstrapUrl).ifPresent(e -> builder.setBootstrapUrl(bootstrapUrl));
Optional.ofNullable(startupFlags).ifPresent(e -> builder.addAllStartupFlags(startupFlags));
return builder.build();
}
Expand Down

0 comments on commit b237513

Please sign in to comment.