mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-09 19:12:36 +02:00
Verify validId before reporting a winning reponse to a proposal.
This commit is contained in:
parent
1a0017900c
commit
8b27b90566
2 changed files with 5 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
(function () {
|
||||
// See tests/performance/tribbles.js
|
||||
Script.include("../libraries/virtualBaton.39.js");
|
||||
Script.include("../libraries/virtualBaton.40.js");
|
||||
var dimensions, oldColor, entityID,
|
||||
editRate = 60,
|
||||
moveRate = 1,
|
|
@ -219,7 +219,10 @@ function virtualBatonf(options) {
|
|||
var response = {proposalNumber: data.number, proposerId: data.proposerId};
|
||||
if (betterNumber(data, bestProposal)) {
|
||||
bestProposal = data;
|
||||
if (accepted.winner) {
|
||||
// For stability, we don't let any one proposer rule out a disconnnected winner.
|
||||
// If someone notices that a winner has disconnected (in their recheckWatchdog),
|
||||
// they call for a new election. To remain chosen, a quorum need to confirm here.
|
||||
if (accepted.winner && connectionTest(accepted.winner)) {
|
||||
response.number = accepted.number;
|
||||
response.winner = accepted.winner;
|
||||
}
|
Loading…
Reference in a new issue