diff options
author | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-10-20 16:12:23 +0000 |
---|---|---|
committer | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-10-20 16:12:23 +0000 |
commit | d9c6b09ac42d21abd151a0feaff676b8a8a24bb9 (patch) | |
tree | c855864e24f765881448e581fca30945207ba34e /net.h | |
parent | 2ea5fa07105ef52ba94c43e6a70a14ef6008abb0 (diff) |
Gavin Andresen: multiple instance check, -testnet use port 18333
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@170 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'net.h')
-rw-r--r-- | net.h | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -12,7 +12,7 @@ extern int nBestHeight; -static const unsigned short DEFAULT_PORT = 0x8d20; // htons(8333) +inline unsigned short GetDefaultPort() { return fTestNet ? htons(18333) : htons(8333); } static const unsigned int PUBLISH_HOPS = 5; enum { @@ -150,11 +150,11 @@ public: Init(); } - CAddress(unsigned int ipIn, unsigned short portIn=DEFAULT_PORT, uint64 nServicesIn=NODE_NETWORK) + CAddress(unsigned int ipIn, unsigned short portIn=0, uint64 nServicesIn=NODE_NETWORK) { Init(); ip = ipIn; - port = portIn; + port = (portIn == 0 ? GetDefaultPort() : portIn); nServices = nServicesIn; } @@ -185,7 +185,7 @@ public: nServices = NODE_NETWORK; memcpy(pchReserved, pchIPv4, sizeof(pchReserved)); ip = INADDR_NONE; - port = DEFAULT_PORT; + port = GetDefaultPort(); nTime = GetAdjustedTime(); nLastTry = 0; } @@ -193,7 +193,7 @@ public: bool SetAddress(const char* pszIn) { ip = INADDR_NONE; - port = DEFAULT_PORT; + port = GetDefaultPort(); char psz[100]; strlcpy(psz, pszIn, sizeof(psz)); unsigned int a=0, b=0, c=0, d=0, e=0; |