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.
pull/490/head
Daniel Karzel 3 years ago
parent 1aaffb09f9
commit 4dd696ebe1
No known key found for this signature in database
GPG Key ID: 30C3FC2E438ADB6E

@ -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")

Loading…
Cancel
Save