p2p thread pool for regtest has only 1 thread
This commit is contained in:
parent
cf85285112
commit
e07dfbb6c1
|
@ -1,6 +1,6 @@
|
|||
use std::net::SocketAddr;
|
||||
use sync::create_sync_connection_factory;
|
||||
use message::Services;
|
||||
use message::{Services, Magic};
|
||||
use util::{open_db, init_db, node_table_path};
|
||||
use {config, p2p};
|
||||
|
||||
|
@ -10,8 +10,13 @@ pub fn start(cfg: config::Config) -> Result<(), String> {
|
|||
let db = open_db(&cfg);
|
||||
try!(init_db(&cfg, &db));
|
||||
|
||||
let p2p_threads = match cfg.magic {
|
||||
Magic::Regtest => 1,
|
||||
Magic::Testnet | Magic::Mainnet => 4,
|
||||
};
|
||||
|
||||
let p2p_cfg = p2p::Config {
|
||||
threads: 4,
|
||||
threads: p2p_threads,
|
||||
protocol_minimum: 70001,
|
||||
protocol_maximum: 70017,
|
||||
inbound_connections: 10,
|
||||
|
|
Loading…
Reference in New Issue