From 4dd696ebe15391e06886f10957f834b969b1121e Mon Sep 17 00:00:00 2001 From: Daniel Karzel Date: Thu, 13 May 2021 16:19:18 +1000 Subject: [PATCH] Fix `monero-wallet-rpc` startup for mainnet CLI There is no `--mainnet` flag. Since we cannot just pass an empty string to `.arg()` we use the `.args()` method to pass nothing for mainnet and the respective flags for stagenet and testnet. --- swap/src/monero/wallet_rpc.rs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/swap/src/monero/wallet_rpc.rs b/swap/src/monero/wallet_rpc.rs index 24495530..9a6619ea 100644 --- a/swap/src/monero/wallet_rpc.rs +++ b/swap/src/monero/wallet_rpc.rs @@ -126,15 +126,23 @@ impl WalletRpc { "Starting monero-wallet-rpc on" ); + let network_flag = match network { + Network::Mainnet => { + vec![] + } + Network::Stagenet => { + vec!["--stagenet"] + } + Network::Testnet => { + vec!["--testnet"] + } + }; + let mut child = Command::new(self.exec_path()) .env("LANG", "en_AU.UTF-8") .stdout(Stdio::piped()) .kill_on_drop(true) - .arg(match network { - Network::Mainnet => "--mainnet", - Network::Stagenet => "--stagenet", - Network::Testnet => "--testnet", - }) + .args(network_flag) .arg("--daemon-address") .arg(daemon_address) .arg("--rpc-bind-port")