Set quorum to tolerate 2 failures for validator list of 6 members.

This commit is contained in:
Mark Travis
2017-10-18 01:08:43 -07:00
committed by Brad Chase
parent 044dd53513
commit dffb999efb
2 changed files with 5 additions and 5 deletions

View File

@@ -573,7 +573,7 @@ ValidatorList::calculateMinimumQuorum (
{
// Only require 51% quorum for small number of validators to facilitate
// bootstrapping a network.
if (nListedKeys <= 5)
if (nListedKeys <= 6)
return nListedKeys/2 + 1;
// The number of listed validators is increased to preserve the safety

View File

@@ -834,8 +834,8 @@ private:
emptyLocalKey, cfgKeys, cfgPublishers));
trustedKeys->onConsensusStart (activeValidators);
BEAST_EXPECT(trustedKeys->quorum () ==
(cfgKeys.size() <= 5) ? cfgKeys.size()/2 + 1 :
cfgKeys.size() * 2/3 + 1);
((cfgKeys.size() <= 6) ? cfgKeys.size()/2 + 1 :
cfgKeys.size() * 2/3 + 1));
for (auto const& key : activeValidators)
BEAST_EXPECT(trustedKeys->trusted (key));
}
@@ -865,8 +865,8 @@ private:
trustedKeys->onConsensusStart (activeValidators);
BEAST_EXPECT(trustedKeys->quorum () ==
(cfgKeys.size() <= 5) ? cfgKeys.size()/2 + 1 :
(cfgKeys.size() + 1) * 2/3 + 1);
((cfgKeys.size() <= 6) ? cfgKeys.size()/2 + 1 :
(cfgKeys.size() + 1) * 2/3 + 1));
for (auto const& key : activeValidators)
BEAST_EXPECT(trustedKeys->trusted (key));