aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-01-04 23:39:45 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2012-02-24 13:41:04 +0100
commit5fee401fe14aa6459428a26a82f764db70a6a0b9 (patch)
tree7920219dabcdd335a7432aa05081d168c98dbf06 /src/net.h
parent8c12851ed497797684588e09637d80a5abd5725e (diff)
downloadbitcoin-5fee401fe14aa6459428a26a82f764db70a6a0b9.tar.xz
CAddrMan: stochastic address manager
Design goals: * Only keep a limited number of addresses around, so that addr.dat does not grow without bound. * Keep the address tables in-memory, and occasionally write the table to addr.dat. * Make sure no (localized) attacker can fill the entire table with his nodes/addresses. See comments in addrman.h for more detailed information.
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/net.h b/src/net.h
index 51a816d4d3..6fd494487c 100644
--- a/src/net.h
+++ b/src/net.h
@@ -16,6 +16,7 @@
#include "netbase.h"
#include "protocol.h"
+#include "addrman.h"
class CAddrDB;
class CRequestTracker;
@@ -31,7 +32,6 @@ static const unsigned int PUBLISH_HOPS = 5;
bool RecvLine(SOCKET hSocket, std::string& strLine);
bool GetMyExternalIP(CNetAddr& ipRet);
-bool AddAddress(CAddress addr, int64 nTimePenalty=0, CAddrDB *pAddrDB=NULL);
void AddressCurrentlyConnected(const CService& addr);
CNode* FindNode(const CNetAddr& ip);
CNode* FindNode(const CService& ip);
@@ -79,6 +79,7 @@ enum threadId
THREAD_UPNP,
THREAD_DNSSEED,
THREAD_ADDEDCONNECTIONS,
+ THREAD_DUMPADDRESS,
THREAD_MAX
};
@@ -89,11 +90,10 @@ extern uint64 nLocalServices;
extern CAddress addrLocalHost;
extern uint64 nLocalHostNonce;
extern boost::array<int, THREAD_MAX> vnThreadsRunning;
+extern CAddrMan addrman;
extern std::vector<CNode*> vNodes;
extern CCriticalSection cs_vNodes;
-extern std::map<std::vector<unsigned char>, CAddress> mapAddresses;
-extern CCriticalSection cs_mapAddresses;
extern std::map<CInv, CDataStream> mapRelay;
extern std::deque<std::pair<int64, CInv> > vRelayExpiration;
extern CCriticalSection cs_mapRelay;