use local chain_type and global chain_type as necessary

This commit is contained in:
antiochp
2020-05-22 14:35:35 +01:00
parent 2769436117
commit 72ff4b4e13
19 changed files with 79 additions and 49 deletions
+1 -1
View File
@@ -141,7 +141,7 @@ fn real_main() -> i32 {
log_build_info();
global::set_mining_mode(
global::init_global_chain_type(
config
.members
.as_ref()
-14
View File
@@ -32,7 +32,6 @@ use grin_wallet_libwallet::Slate;
use grin_wallet_libwallet::{IssueInvoiceTxArgs, NodeClient, WalletInst, WalletLCProvider};
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_core::core::amount_to_hr_string;
use grin_wallet_util::grin_core::global;
use grin_wallet_util::grin_keychain as keychain;
use grin_wallet_util::OnionV3Address;
use linefeed::terminal::Signal;
@@ -275,18 +274,9 @@ pub fn parse_global_args(
}
};
let chain_type = match config.chain_type.clone() {
None => {
let param_ref = global::CHAIN_TYPE.read();
param_ref.clone()
}
Some(c) => c,
};
Ok(command::GlobalArgs {
account: account.to_owned(),
show_spent: show_spent,
chain_type: chain_type,
api_secret: api_secret,
node_api_secret: node_api_secret,
password: password,
@@ -843,10 +833,6 @@ where
>,
),
{
if let Some(t) = wallet_config.chain_type.clone() {
core::global::set_mining_mode(t);
}
if wallet_args.is_present("external") {
wallet_config.api_listen_interface = "0.0.0.0".to_string();
}