Keep port information for local addresses

This commit is contained in:
Pieter Wuille
2012-05-10 20:35:13 +02:00
parent 457754d2c2
commit 7fa4443f77
3 changed files with 29 additions and 22 deletions

View File

@@ -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;