Weaken assertion in PeerFinder

It can be inactive with no leader if it's handling an incoming PeersRequest
before being activated for the first time.
This commit is contained in:
David Turner 2018-12-01 07:20:19 +00:00
parent 3a5dab6d8e
commit 9cc416bc46
1 changed files with 1 additions and 1 deletions

View File

@ -161,7 +161,7 @@ public abstract class PeerFinder {
peersRequest.getKnownPeers().stream().map(DiscoveryNode::getAddress).forEach(this::startProbe);
knownPeers = getFoundPeersUnderLock();
} else {
assert leader.isPresent();
assert leader.isPresent() || lastAcceptedNodes == null;
knownPeers = Collections.emptyList();
}
return new PeersResponse(leader, knownPeers, currentTerm);