Instantaneous blacklisting and credential revocation.

This commit is contained in:
Adam Ierymenko 2016-08-23 13:46:36 -07:00
parent 32fa061700
commit 0a7a33ef8f
6 changed files with 94 additions and 41 deletions

View file

@ -888,16 +888,12 @@ bool Network::_isAllowed(const SharedPtr<Peer> &peer) const
// Assumes _lock is locked
try {
if (_config) {
if (_config.isPublic()) {
return true;
} else {
const Membership *m = _memberships.get(peer->address());
if (m)
return _config.com.agreesWith(m->com());
}
const Membership *const m = _memberships.get(peer->address());
if (m)
return m->isAllowedOnNetwork(_config);
}
} catch ( ... ) {
TRACE("isAllowed() check failed for peer %s: unexpected exception: unexpected exception",peer->address().toString().c_str());
TRACE("isAllowed() check failed for peer %s: unexpected exception",peer->address().toString().c_str());
}
return false;
}