Add amSupernode to make code clearer in the check-if-self-is-supernode case.
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user