Add amSupernode to make code clearer in the check-if-self-is-supernode case.

This commit is contained in:
Adam Ierymenko 2013-07-23 10:23:55 -07:00
parent b8e9a79d00
commit 0c7f8e247c
4 changed files with 30 additions and 10 deletions

View file

@ -162,6 +162,11 @@ public:
return (_supernodeAddresses.count(zta) > 0);
}
/**
* @return True if this node's identity is in the supernode set
*/
inline bool amSupernode() const { return _amSupernode; }
/**
* Clean and flush database now (runs in the background)
*/
@ -305,6 +310,9 @@ private:
std::vector< SharedPtr<Peer> > _supernodePeers;
Mutex _supernodes_m;
// Set to true if my identity is in _supernodes
volatile bool _amSupernode;
KISSDB _dbm;
Mutex _dbm_m;
};