Fix inconsistent wallet receiver port

Fixes #96
This commit is contained in:
Yeastplume 2017-08-19 00:01:19 +01:00 committed by Ignotus Peverell
parent 900c52424d
commit b61c0607c2
2 changed files with 5 additions and 7 deletions

View file

@ -282,13 +282,11 @@ fn wallet_command(wallet_args: &ArgMatches) {
"Error deriving extended key from seed.", "Error deriving extended key from seed.",
); );
let default_ip = "127.0.0.1";
let mut addr = format!("{}:13416", default_ip);
let mut wallet_config = WalletConfig::default(); let mut wallet_config = WalletConfig::default();
if let Some(port) = wallet_args.value_of("port") { if let Some(port) = wallet_args.value_of("port") {
addr = format!("{}:{}", default_ip, port); let default_ip = "127.0.0.1";
wallet_config.api_http_addr = format!("http://{}", addr).to_string(); wallet_config.api_http_addr = format!("{}:{}", default_ip, port);
} }
if let Some(dir) = wallet_args.value_of("dir") { if let Some(dir) = wallet_args.value_of("dir") {
@ -319,10 +317,10 @@ fn wallet_command(wallet_args: &ArgMatches) {
"/receive".to_string(), "/receive".to_string(),
wallet::WalletReceiver { wallet::WalletReceiver {
key: key, key: key,
config: wallet_config, config: wallet_config.clone(),
}, },
); );
apis.start(addr).unwrap_or_else(|e| { apis.start(wallet_config.api_http_addr).unwrap_or_else(|e| {
error!("Failed to start Grin wallet receiver: {}.", e); error!("Failed to start Grin wallet receiver: {}.", e);
}); });
} }

View file

@ -93,7 +93,7 @@ impl Default for WalletConfig {
fn default() -> WalletConfig { fn default() -> WalletConfig {
WalletConfig { WalletConfig {
enable_wallet: false, enable_wallet: false,
api_http_addr: "http://127.0.0.1:13415".to_string(), api_http_addr: "127.0.0.1:13416".to_string(),
check_node_api_http_addr: "http://127.0.0.1:13415".to_string(), check_node_api_http_addr: "http://127.0.0.1:13415".to_string(),
data_file_dir: ".".to_string(), data_file_dir: ".".to_string(),
} }