Browse Source

Remove NodeMode from ethereum.

cl-refactor
Gav Wood 10 years ago
parent
commit
12f6768abe
  1. 2
      alethzero/MainWin.cpp
  2. 6
      eth/main.cpp
  3. 6
      libethereum/Client.h
  4. 2
      libp2p/Host.cpp
  5. 6
      neth/main.cpp

2
alethzero/MainWin.cpp

@ -1811,8 +1811,6 @@ void Main::on_net_triggered()
web3()->setClientVersion(n);
if (ui->net->isChecked())
{
// TODO: alter network stuff?
//ui->port->value(), string(), 0, NodeMode::Full, ui->idealPeers->value(), ui->forceAddress->text().toStdString(), ui->upnp->isChecked(), m_privateChain.size() ? sha3(m_privateChain.toStdString()) : 0
web3()->setIdealPeerCount(ui->idealPeers->value());
web3()->setNetworkPreferences(netPrefs());
ethereum()->setNetworkId(m_privateChain.size() ? sha3(m_privateChain.toStdString()) : 0);

6
eth/main.cpp

@ -180,6 +180,12 @@ void sighandler(int)
g_exit = true;
}
enum class NodeMode
{
PeerServer,
Full
};
int main(int argc, char** argv)
{
unsigned short listenPort = 30303;

6
libethereum/Client.h

@ -57,12 +57,6 @@ enum ClientWorkState
Deleted
};
enum class NodeMode
{
PeerServer,
Full
};
class VersionChecker
{
public:

2
libp2p/Host.cpp

@ -558,7 +558,7 @@ void Host::prunePeers()
for (auto i: m_peers)
if (!dc.count(i.first))
if (auto p = i.second.lock())
if (/*(m_mode != NodeMode::Host || p->m_caps != 0x01) &&*/ chrono::steady_clock::now() > p->m_connect + chrono::milliseconds(old)) // don't throw off new peers; peer-servers should never kick off other peer-servers.
if (chrono::steady_clock::now() > p->m_connect + chrono::milliseconds(old)) // don't throw off new peers; peer-servers should never kick off other peer-servers.
{
++agedPeers;
if ((!worst || p->rating() < worst->rating() || (p->rating() == worst->rating() && p->m_connect > worst->m_connect))) // kill older ones

6
neth/main.cpp

@ -292,6 +292,12 @@ int nc_window_streambuf::sync()
vector<string> form_dialog(vector<string> _sfields, vector<string> _lfields, vector<string> _bfields, int _cols, int _rows, string _post_form);
enum class NodeMode
{
PeerServer,
Full
};
int main(int argc, char** argv)
{
unsigned short listenPort = 30303;

Loading…
Cancel
Save