Skip to content

Commit

Permalink
Fix for ThreeMammals#15
Browse files Browse the repository at this point in the history
  • Loading branch information
biesigrr committed Jul 18, 2018
1 parent 98e7d50 commit c46ec79
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Rafty/Concensus/States/Leader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,12 @@ private async Task SendAppendEntries(int electionTimerId)
var nextIndex = new NextIndex(p, await _log.LastLogIndex());
PeerStates.Add(new PeerState(p, matchIndex, nextIndex));
});

var peerStatesNotInPeers = PeerStates.Where(p => !peers.Select(x => x.Id).Contains(p.Peer.Id)).ToList();
foreach (var peerState in peerStatesNotInPeers)
{
PeerStates.Remove(peerState);
}
}

var appendEntriesResponses = SetUpAppendingEntries();
Expand Down

0 comments on commit c46ec79

Please sign in to comment.