From 12f6768abe1476507dc7da4935b4f83c9d956b13 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sun, 11 Jan 2015 21:01:55 +0100 Subject: [PATCH] Remove NodeMode from ethereum. --- alethzero/MainWin.cpp | 2 -- eth/main.cpp | 6 ++++++ libethereum/Client.h | 6 ------ libp2p/Host.cpp | 2 +- neth/main.cpp | 6 ++++++ 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index a03c7908f..7039070a1 100644 --- a/alethzero/MainWin.cpp +++ b/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); diff --git a/eth/main.cpp b/eth/main.cpp index a0a605193..dfe020763 100644 --- a/eth/main.cpp +++ b/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; diff --git a/libethereum/Client.h b/libethereum/Client.h index a4d04f54d..0c9c25fb1 100644 --- a/libethereum/Client.h +++ b/libethereum/Client.h @@ -57,12 +57,6 @@ enum ClientWorkState Deleted }; -enum class NodeMode -{ - PeerServer, - Full -}; - class VersionChecker { public: diff --git a/libp2p/Host.cpp b/libp2p/Host.cpp index d1c3cd19b..4be6f228f 100644 --- a/libp2p/Host.cpp +++ b/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 diff --git a/neth/main.cpp b/neth/main.cpp index 0b48edc11..1252b205b 100644 --- a/neth/main.cpp +++ b/neth/main.cpp @@ -292,6 +292,12 @@ int nc_window_streambuf::sync() vector form_dialog(vector _sfields, vector _lfields, vector _bfields, int _cols, int _rows, string _post_form); +enum class NodeMode +{ + PeerServer, + Full +}; + int main(int argc, char** argv) { unsigned short listenPort = 30303;