Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
todo notes
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelsavannah committed Sep 17, 2019
1 parent 870a19c commit d76be8f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions crud/crud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,7 @@ crud::is_caller_a_writer(const bzn::caller_id_t& caller_id, const Json::Value& p
}

// A node may be issuing an operation such as delete for key expiration...
// TODO: this may need to compare against all recent peers, not just current ones
for (const auto& peer_uuid : *this->pbft->peers()->current())
{
if (peer_uuid.uuid == boost::trim_copy(caller_id))
Expand Down
2 changes: 2 additions & 0 deletions pbft/operations/pbft_memory_operation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,14 @@ pbft_memory_operation::is_preprepared() const
bool
pbft_memory_operation::is_ready_for_commit() const
{
// TODO: may have to count based only on uuids that are still in the peers list
return this->has_request() && this->is_preprepared() && this->prepares_seen.size() >= pbft::honest_majority_size(this->peers->current()->size());
}

bool
pbft_memory_operation::is_ready_for_execute() const
{
// TODO: may have to count based only on uuids that are still in the peers list
return this->is_prepared() && this->commits_seen.size() >= pbft::honest_majority_size(this->peers->current()->size());
}

Expand Down
2 changes: 1 addition & 1 deletion pbft/pbft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ pbft::quorum_size() const
size_t
pbft::max_faulty_nodes() const
{
return this->peers_beacon->current()->size()/3;
return (this->peers_beacon->current()->size()-1)/3;
}

void
Expand Down

0 comments on commit d76be8f

Please sign in to comment.