From f61ffdef3f4a1f9bccfae59d0d460bc758d2cae0 Mon Sep 17 00:00:00 2001 From: Daniel Hams Date: Mon, 17 Feb 2014 11:56:57 +0000 Subject: [PATCH] Fix up IP port number to be ushort where it is used instead of short. --- alethzero/MainWin.cpp | 2 +- eth/main.cpp | 4 ++-- libethereum/Client.cpp | 4 ++-- libethereum/Client.h | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 03aa49321..e6140c3cb 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -278,7 +278,7 @@ void Main::on_connect_triggered() if (ok && s.contains(":")) { string host = s.section(":", 0, 0).toStdString(); - short port = s.section(":", 1).toInt(); + ushort port = s.section(":", 1).toInt(); m_client->connect(host, port); } } diff --git a/eth/main.cpp b/eth/main.cpp index 37e643b68..7155b1e1b 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -155,9 +155,9 @@ void version() int main(int argc, char** argv) { - short listenPort = 30303; + ushort listenPort = 30303; string remoteHost; - short remotePort = 30303; + ushort remotePort = 30303; bool interactive = false; string dbPath; eth::uint mining = ~(eth::uint)0; diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index faeabb04e..dc0f78803 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -62,7 +62,7 @@ Client::~Client() this_thread::sleep_for(chrono::milliseconds(10)); } -void Client::startNetwork(short _listenPort, std::string const& _seedHost, short _port, NodeMode _mode, unsigned _peers, string const& _publicIP, bool _upnp) +void Client::startNetwork(ushort _listenPort, std::string const& _seedHost, ushort _port, NodeMode _mode, unsigned _peers, string const& _publicIP, bool _upnp) { if (m_net) return; @@ -72,7 +72,7 @@ void Client::startNetwork(short _listenPort, std::string const& _seedHost, short connect(_seedHost, _port); } -void Client::connect(std::string const& _seedHost, short _port) +void Client::connect(std::string const& _seedHost, ushort _port) { if (!m_net) return; diff --git a/libethereum/Client.h b/libethereum/Client.h index fb5718dbd..2ed0e4a50 100644 --- a/libethereum/Client.h +++ b/libethereum/Client.h @@ -106,9 +106,9 @@ public: unsigned peerCount() const { return m_net ? m_net->peerCount() : 0; } /// Start the network subsystem. - void startNetwork(short _listenPort = 30303, std::string const& _seedHost = std::string(), short _port = 30303, NodeMode _mode = NodeMode::Full, unsigned _peers = 5, std::string const& _publicIP = std::string(), bool _upnp = true); + void startNetwork(ushort _listenPort = 30303, std::string const& _seedHost = std::string(), ushort _port = 30303, NodeMode _mode = NodeMode::Full, unsigned _peers = 5, std::string const& _publicIP = std::string(), bool _upnp = true); /// Connect to a particular peer. - void connect(std::string const& _seedHost, short _port = 30303); + void connect(std::string const& _seedHost, ushort _port = 30303); /// Stop the network subsystem. void stopNetwork(); /// Get access to the peer server object. This will be null if the network isn't online.