|
|
@ -215,15 +215,15 @@ void Client::startNetwork(unsigned short _listenPort, std::string const& _seedHo |
|
|
|
try |
|
|
|
{ |
|
|
|
m_net.reset(new PeerHost(m_clientVersion, _listenPort, _publicIP, _upnp)); |
|
|
|
if (_mode == NodeMode::Full) |
|
|
|
m_net->registerCapability(new EthereumHost(m_bc, _networkId)); |
|
|
|
} |
|
|
|
catch (std::exception const&) |
|
|
|
{ |
|
|
|
// Probably already have the port open.
|
|
|
|
cwarn << "Could not initialize with specified/default port. Trying system-assigned port"; |
|
|
|
m_net.reset(new EthereumHost(m_clientVersion, m_bc, 0, _mode, _publicIP, _upnp)); |
|
|
|
m_net.reset(new PeerHost(m_clientVersion, 0, _publicIP, _upnp)); |
|
|
|
} |
|
|
|
if (_mode == NodeMode::Full) |
|
|
|
m_net->registerCapability(new EthereumHost(m_bc, _networkId)); |
|
|
|
} |
|
|
|
m_net->setIdealPeerCount(_peers); |
|
|
|
} |
|
|
@ -442,7 +442,7 @@ void Client::workNet() |
|
|
|
|
|
|
|
// returns h256Set as block hashes, once for each block that has come in/gone out.
|
|
|
|
cwork << "NET <==> TQ ; CHAIN ==> NET ==> BQ"; |
|
|
|
m_net->sync(m_tq, m_bq); |
|
|
|
m_net->cap<EthereumHost>()->sync(m_tq, m_bq); |
|
|
|
|
|
|
|
cwork << "TQ:" << m_tq.items() << "; BQ:" << m_bq.items(); |
|
|
|
} |
|
|
|