Merge remote-tracking branch 'parity/master' into bft

Conflicts:
	ethcore/src/error.rs
This commit is contained in:
keorn
2016-08-25 19:24:29 +02:00
132 changed files with 2939 additions and 1692 deletions

View File

@@ -16,7 +16,7 @@ ethcore-util = { path = "../util" }
ethcore-network = { path = "../util/network" }
ethcore-io = { path = "../util/io" }
ethcore = { path = "../ethcore" }
clippy = { version = "0.0.82", optional = true}
clippy = { version = "0.0.85", optional = true}
log = "0.3"
env_logger = "0.3"
time = "0.1.34"

View File

@@ -17,7 +17,7 @@
use std::sync::Arc;
use network::{NetworkProtocolHandler, NetworkService, NetworkContext, PeerId,
NetworkConfiguration as BasicNetworkConfiguration, NonReservedPeerMode, NetworkError};
use util::{U256, H256, Secret, Populatable};
use util::{U256, H256, Populatable};
use io::{TimerToken};
use ethcore::client::{BlockChainClient, ChainNotify};
use ethcore::header::BlockNumber;
@@ -258,8 +258,10 @@ impl ManageNetwork for EthSync {
#[derive(Binary, Debug, Clone, PartialEq, Eq)]
/// Network service configuration
pub struct NetworkConfiguration {
/// Directory path to store network configuration. None means nothing will be saved
/// Directory path to store general network configuration. None means nothing will be saved
pub config_path: Option<String>,
/// Directory path to store network-specific configuration. None means nothing will be saved
pub net_config_path: Option<String>,
/// IP address to listen for incoming connections. Listen to all connections by default
pub listen_address: Option<String>,
/// IP address to advertise. Detected automatically if none.
@@ -273,7 +275,7 @@ pub struct NetworkConfiguration {
/// List of initial node addresses
pub boot_nodes: Vec<String>,
/// Use provided node key instead of default
pub use_secret: Option<Secret>,
pub use_secret: Option<H256>,
/// Max number of connected peers to maintain
pub max_peers: u32,
/// Min number of connected peers to maintain
@@ -307,6 +309,7 @@ impl NetworkConfiguration {
Ok(BasicNetworkConfiguration {
config_path: self.config_path,
net_config_path: self.net_config_path,
listen_address: match self.listen_address { None => None, Some(addr) => Some(try!(SocketAddr::from_str(&addr))) },
public_address: match self.public_address { None => None, Some(addr) => Some(try!(SocketAddr::from_str(&addr))) },
udp_port: self.udp_port,
@@ -326,6 +329,7 @@ impl From<BasicNetworkConfiguration> for NetworkConfiguration {
fn from(other: BasicNetworkConfiguration) -> Self {
NetworkConfiguration {
config_path: other.config_path,
net_config_path: other.net_config_path,
listen_address: other.listen_address.and_then(|addr| Some(format!("{}", addr))),
public_address: other.public_address.and_then(|addr| Some(format!("{}", addr))),
udp_port: other.udp_port,
@@ -345,4 +349,5 @@ impl From<BasicNetworkConfiguration> for NetworkConfiguration {
pub struct ServiceConfiguration {
pub sync: SyncConfig,
pub net: NetworkConfiguration,
pub io_path: String,
}