Logic simplification, cleanup, and memory use improvements in Membership. Also fix an issue that may cause network instability in some cases.

This commit is contained in:
Adam Ierymenko 2017-04-04 08:07:38 -07:00
parent 8a62ba07e5
commit eddbc7e757
10 changed files with 175 additions and 124 deletions

View file

@ -20,6 +20,7 @@
#define ZT_CERTIFICATEOFREPRESENTATION_HPP
#include "Constants.hpp"
#include "Credential.hpp"
#include "Address.hpp"
#include "C25519.hpp"
#include "Identity.hpp"
@ -47,14 +48,17 @@ namespace ZeroTier {
* roots can shield nodes entirely and p2p connectivity behind them can
* be disabled. This will be desirable for a number of use cases.
*/
class CertificateOfRepresentation
class CertificateOfRepresentation : public Credential
{
public:
static inline Credential::Type credentialType() { return Credential::CREDENTIAL_TYPE_COR; }
CertificateOfRepresentation()
{
memset(this,0,sizeof(CertificateOfRepresentation));
}
inline uint32_t id() const { return 0; }
inline uint64_t timestamp() const { return _timestamp; }
inline const Address &representative(const unsigned int i) const { return _reps[i]; }
inline unsigned int repCount() const { return _repCount; }