Support for multiple local addresses

This commit is contained in:
Pieter Wuille
2012-02-12 13:45:24 +01:00
parent 478b01d9a7
commit 39857190de
8 changed files with 187 additions and 88 deletions

View File

@@ -42,6 +42,21 @@ bool BindListenPort(std::string& strError=REF(std::string()));
void StartNode(void* parg);
bool StopNode();
enum
{
LOCAL_NONE,
LOCAL_IF,
LOCAL_UPNP,
LOCAL_IRC,
LOCAL_HTTP,
};
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);
CAddress GetLocalAddress(const CNetAddr *paddrPeer = NULL);
enum
{
MSG_TX = 1,
@@ -85,7 +100,6 @@ enum threadId
extern bool fClient;
extern uint64 nLocalServices;
extern CAddress addrLocalHost;
extern uint64 nLocalHostNonce;
extern boost::array<int, THREAD_MAX> vnThreadsRunning;
extern CAddrMan addrman;
@@ -121,6 +135,7 @@ public:
unsigned int nMessageStart;
CAddress addr;
std::string addrName;
CNetAddr addrLocal;
int nVersion;
std::string strSubVer;
bool fOneShot;