Skip to content
Snippets Groups Projects

Elois/bc

Merged Éloïs requested to merge elois/bc into dev
52 files
+ 989
825
Compare changes
  • Side-by-side
  • Inline
Files
52
+ 16
6
@@ -319,24 +319,34 @@ impl DursCore<DuRsConf> {
@@ -319,24 +319,34 @@ impl DursCore<DuRsConf> {
// Get profile path
// Get profile path
let profile_path = self.soft_meta_datas.profile_path;
let profile_path = self.soft_meta_datas.profile_path;
 
// Define sync_opts
 
let sync_opts_opt = if let Some(ServerMode::Sync(sync_opts)) = self.server_command {
 
Some(sync_opts)
 
} else {
 
None
 
};
 
 
// Define cautious mode
 
let cautious_mode = if let Some(ref sync_opts) = sync_opts_opt {
 
sync_opts.cautious_mode
 
} else {
 
true
 
};
 
// Instantiate blockchain module and load is conf
// Instantiate blockchain module and load is conf
let mut blockchain_module = BlockchainModule::load_blockchain_conf(
let mut blockchain_module = BlockchainModule::load_blockchain_conf(
bc_db,
bc_db,
router_sender.clone(),
router_sender.clone(),
profile_path,
profile_path,
RequiredKeysContent::MemberKeyPair(None),
RequiredKeysContent::MemberKeyPair(None),
 
cautious_mode,
);
);
info!("Success to load Blockchain module.");
info!("Success to load Blockchain module.");
// Start blockchain module in thread
// Start blockchain module in thread
let thread_builder = thread::Builder::new().name(BlockchainModule::name().0.into());
let thread_builder = thread::Builder::new().name(BlockchainModule::name().0.into());
let sync_opts = if let Some(ServerMode::Sync(opts)) = self.server_command {
Some(opts)
} else {
None
};
let blockchain_thread_handler = thread_builder
let blockchain_thread_handler = thread_builder
.spawn(move || blockchain_module.start_blockchain(&blockchain_receiver, sync_opts))
.spawn(move || blockchain_module.start_blockchain(&blockchain_receiver, sync_opts_opt))
.expect("Fatal error: fail to spawn module main thread !");
.expect("Fatal error: fail to spawn module main thread !");
// Wait until all modules threads are finished
// Wait until all modules threads are finished
Loading