aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-05-10 20:35:13 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2012-05-11 15:29:19 +0200
commit7fa4443f77a659031e277337770b506fcf954d69 (patch)
tree9464645df0c9ed33668586fe924d4c02e54ec1a1 /src/net.h
parent457754d2c24f7e53c55f4b68155a5fa702552327 (diff)
Keep port information for local addresses
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/net.h b/src/net.h
index be167b001f..398b89dcfc 100644
--- a/src/net.h
+++ b/src/net.h
@@ -44,22 +44,23 @@ bool StopNode();
enum
{
- LOCAL_NONE,
- LOCAL_IF,
- LOCAL_UPNP,
- LOCAL_IRC,
- LOCAL_HTTP,
- LOCAL_MANUAL,
+ LOCAL_NONE, // unknown
+ LOCAL_IF, // address a local interface listens on
+ LOCAL_UPNP, // address reported by UPnP
+ LOCAL_IRC, // address reported by IRC (deprecated)
+ LOCAL_HTTP, // address reported by whatismyip.com and similars
+ LOCAL_MANUAL, // address explicitly specified (-externalip=)
LOCAL_MAX
};
void SetLimited(enum Network net, bool fLimited = true);
bool IsLimited(const CNetAddr& addr);
-bool AddLocal(const CNetAddr& addr, int nScore = LOCAL_NONE);
-bool SeenLocal(const CNetAddr& addr);
-bool IsLocal(const CNetAddr& addr);
-bool GetLocal(CNetAddr &addr, const CNetAddr *paddrPeer = NULL);
+bool AddLocal(const CService& addr, int nScore = LOCAL_NONE);
+bool AddLocal(const CNetAddr& addr, int nScore = LOCAL_NONE, int port = -1);
+bool SeenLocal(const CService& addr);
+bool IsLocal(const CService& addr);
+bool GetLocal(CService &addr, const CNetAddr *paddrPeer = NULL);
bool IsReachable(const CNetAddr &addr);
CAddress GetLocalAddress(const CNetAddr *paddrPeer = NULL);
@@ -142,7 +143,7 @@ public:
unsigned int nMessageStart;
CAddress addr;
std::string addrName;
- CNetAddr addrLocal;
+ CService addrLocal;
int nVersion;
std::string strSubVer;
bool fOneShot;