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.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;
@ -612,8 +611,7 @@ public final class XmrConnectionService {
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();

View file

@ -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());
}

View file

@ -50,7 +50,7 @@ public class XmrNodeSettings implements PersistableEnvelope {
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();
}