This commit is contained in:
Pieter Wuille 2011-12-16 18:51:45 +01:00
parent e45e41c0c5
commit 7ebdde3715

20
db.h
View file

@ -20,16 +20,24 @@ private:
double weight;
}
// seen nodes
// / \
// (a) banned nodes tracked nodes
// / \
// tried nodes (b) unknown nodes
// / \
// (d) good nodes (c) non-good nodes
class CAddrDb {
private:
CCriticalSection cs;
int nId; // number of address id's
map<int, CAddrInfo> idToInfo; // map address id to address info
map<CIP, int> ipToId; // map ip to id
deque<int> ourId; // sequence of tracked nodes, in order we have tried connecting to them
set<int> unkId; // set of nodes not yet tried
set<int> goodId; // set of good nodes
map<CIP, pair<uint32_t, uint32_t> > banned; // nodes that are banned, with their from/to ban time
map<int, CAddrInfo> idToInfo; // map address id to address info (b,c,d)
map<CIP, int> ipToId; // map ip to id (b,c,d)
deque<int> ourId; // sequence of tried nodes, in order we have tried connecting to them (c,d)
set<int> unkId; // set of nodes not yet tried (b)
set<int> goodId; // set of good nodes (d)
map<CIP, pair<uint32_t, uint32_t> > banned; // nodes that are banned, with their from/to ban time (a)
public:
void Add(const CAddress &addr);