commit method

bool commit(
  1. Map<int, bool> votes
)

Given a set of boolean accepts, decide if commit quorum met.

Implementation

bool commit(Map<int, bool> votes) {
  final accepts = votes.values.where((v) => v).length;
  return accepts >= commitQuorum();
}