Make sure of proper command line arguments.
MODIFY
WalletWasabi/BitcoinCore/Configuration/NetworkTranslator.cs
WalletWasabi/BitcoinCore/Configuration/NetworkTranslator.cs
@@ -61,5 +61,26 @@ namespace WalletWasabi.BitcoinCore.Configuration
throw new NotSupportedNetworkException(network);
}
}
+
+ public static string GetCommandLineArguments(Network network)
+ {
+ Guard.NotNull(nameof(network), network);
+ if (network == Network.Main)
+ {
+ return "-regtest=0 -testnet=0";
+ }
+ else if (network == Network.TestNet)
+ {
+ return "-regtest=0 -testnet=1";
+ }
+ else if (network == Network.RegTest)
+ {
+ return "-regtest=1 -testnet=0";
+ }
+ else
+ {
+ throw new NotSupportedNetworkException(network);
+ }
+ }
}
}

MODIFY
WalletWasabi/BitcoinCore/Configuration/PidFile.cs
WalletWasabi/BitcoinCore/Configuration/PidFile.cs
@@ -43,7 +43,7 @@ namespace WalletWasabi.BitcoinCore.Configuration
public void Delete()
{
- if (File.Exists(FilePath)
+ if (File.Exists(FilePath))
{
File.Delete(FilePath);
}

MODIFY
WalletWasabi/BitcoinCore/CoreNode.cs
WalletWasabi/BitcoinCore/CoreNode.cs
@@ -133,7 +133,7 @@ namespace WalletWasabi.BitcoinCore
var configFileName = Path.GetFileName(configPath);
coreNode.Bridge = new BitcoindProcessBridge();
- coreNode.Process = coreNode.Bridge.Start($"-{coreNode.Network.ToString().ToLowerInvariant()} -conf={configFileName} -datadir={coreNode.DataDir} -printtoconsole=0", false);
+ coreNode.Process = coreNode.Bridge.Start($"{NetworkTranslator.GetCommandLineArguments(coreNode.Network)} -conf={configFileName} -datadir={coreNode.DataDir} -printtoconsole=0", false);
var pidFile = new PidFile(coreNode.DataDir, coreNode.Network);
await pidFile.SerializeAsync(coreNode.Process.Id).ConfigureAwait(false);
@@ -148,10 +148,10 @@ namespace WalletWasabi.BitcoinCore
catch (Exception ex)
{
Logger.LogTrace(ex);
- }
if (coreNode.Process is null || coreNode.Process.HasExited)
{
- break;
+ throw ex;
+ }
}
}

Make sure of proper command line arguments.