fixes for local monerod

This commit is contained in:
woodser 2024-01-17 20:31:42 -05:00
parent 947caca647
commit 75e85179b4
3 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,6 @@ package haveno.core.api;
import haveno.common.ThreadUtils; import haveno.common.ThreadUtils;
import haveno.common.UserThread; import haveno.common.UserThread;
import haveno.common.app.DevEnv; import haveno.common.app.DevEnv;
import haveno.common.config.BaseCurrencyNetwork;
import haveno.common.config.Config; import haveno.common.config.Config;
import haveno.core.trade.HavenoUtils; import haveno.core.trade.HavenoUtils;
import haveno.core.user.Preferences; import haveno.core.user.Preferences;
@ -612,8 +611,7 @@ public final class XmrConnectionService {
chainHeight.set(lastInfo.getHeight()); chainHeight.set(lastInfo.getHeight());
// update sync progress // update sync progress
boolean isTestnet = Config.baseCurrencyNetwork() == BaseCurrencyNetwork.XMR_LOCAL; if (lastInfo.isSynchronized()) doneDownload();
if (lastInfo.isSynchronized() || isTestnet) doneDownload(); // TODO: skipping synchronized check for testnet because tests cannot sync 3rd local node, see "Can manage Monero daemon connections"
else if (lastInfo.isBusySyncing()) { else if (lastInfo.isBusySyncing()) {
long targetHeight = lastInfo.getTargetHeight(); long targetHeight = lastInfo.getTargetHeight();
long blocksLeft = targetHeight - lastInfo.getHeight(); long blocksLeft = targetHeight - lastInfo.getHeight();

View File

@ -61,6 +61,8 @@ public class XmrLocalNode {
MONEROD_ARGS.add(MONEROD_PATH); MONEROD_ARGS.add(MONEROD_PATH);
MONEROD_ARGS.add("--no-igd"); MONEROD_ARGS.add("--no-igd");
MONEROD_ARGS.add("--hide-my-port"); 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()); if (!Config.baseCurrencyNetwork().isMainnet()) MONEROD_ARGS.add("--" + Config.baseCurrencyNetwork().getNetwork().toLowerCase());
} }

View File

@ -50,7 +50,7 @@ public class XmrNodeSettings implements PersistableEnvelope {
public protobuf.XmrNodeSettings toProtoMessage() { public protobuf.XmrNodeSettings toProtoMessage() {
protobuf.XmrNodeSettings.Builder builder = protobuf.XmrNodeSettings.newBuilder(); protobuf.XmrNodeSettings.Builder builder = protobuf.XmrNodeSettings.newBuilder();
Optional.ofNullable(blockchainPath).ifPresent(e -> builder.setBlockchainPath(blockchainPath)); 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)); Optional.ofNullable(startupFlags).ifPresent(e -> builder.addAllStartupFlags(startupFlags));
return builder.build(); return builder.build();
} }