Add a peers_preferred option in Grin (#1401)

* Preferred peers option
* Move P2P configuration into proper config part
* Fix tests
This commit is contained in:
Quentin Le Sceller
2018-08-23 21:16:04 +02:00
committed by Ignotus Peverell
parent 2251a82404
commit 8cd1b23f7a
14 changed files with 174 additions and 109 deletions
+4 -5
View File
@@ -13,7 +13,6 @@
// limitations under the License.
/// Grin server commands processing
use std::env::current_dir;
use std::process::exit;
use std::sync::atomic::{AtomicBool, Ordering};
@@ -21,14 +20,15 @@ use std::sync::Arc;
use std::thread;
use std::time::Duration;
use ctrlc;
use clap::ArgMatches;
use ctrlc;
use daemonize::Daemonize;
use cmd::wallet;
use config::GlobalConfig;
use core::global;
use grin_wallet::controller;
use p2p::Seeding;
use servers;
use tui::ui;
use util::LOGGER;
@@ -118,8 +118,8 @@ pub fn server_command(server_args: Option<&ArgMatches>, mut global_config: Globa
}
if let Some(seeds) = a.values_of("seed") {
server_config.seeding_type = servers::Seeding::List;
server_config.seeds = Some(seeds.map(|s| s.to_string()).collect());
server_config.p2p_config.seeding_type = Seeding::List;
server_config.p2p_config.seeds = Some(seeds.map(|s| s.to_string()).collect());
}
}
@@ -192,4 +192,3 @@ pub fn server_command(server_args: Option<&ArgMatches>, mut global_config: Globa
start_server(server_config);
}
}