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

Commit

Permalink
kep-808 rebased to devel
Browse files Browse the repository at this point in the history
  • Loading branch information
rnistuk authored and rnistuk committed Mar 4, 2019
1 parent 31f2b5f commit d18211b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
21 changes: 1 addition & 20 deletions pbft/pbft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1952,25 +1952,6 @@ pbft::generate_random_number(uint32_t min, uint32_t max)
return dist(gen);
}

void
pbft::initialize_persistent_state()
{
persistent<operation_key_t>::init_kv_container<log_key_t>(this->storage, ACCEPTED_PREPREPARES_KEY,
this->accepted_preprepares);
persistent<std::string>::init_kv_container<uuid_t>(this->storage, STABLE_CHECKPOINT_PROOF_KEY,
this->stable_checkpoint_proof);
persistent<std::string>::init_kv_container2<uuid_t, checkpoint_t>(this->storage, UNSTABLE_CHECKPOINT_PROOFS_KEY,
this->unstable_checkpoint_proofs);
persistent<bzn_envelope>::init_kv_container2<uuid_t, uint64_t>(this->storage,
VALID_VIEWCHANGE_MESSAGES_FOR_VIEW_KEY, this->valid_viewchange_messages_for_view);

// sets need a custom initialize callback
persistent<checkpoint_t>::initialize<checkpoint_t>(this->storage, LOCAL_UNSTABLE_CHECKPOINTS_KEY
, [&](auto value, auto /*key*/)
{
this->local_unstable_checkpoints.emplace(value);
});
}
void pbft::add_session_to_sessions_waiting(const std::string &msg_hash, std::shared_ptr<bzn::session_base> session)
{
if (session)
Expand Down Expand Up @@ -2007,4 +1988,4 @@ pbft::initialize_persistent_state()
{
this->local_unstable_checkpoints.emplace(value);
});
}
}
2 changes: 0 additions & 2 deletions pbft/pbft.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,6 @@ namespace bzn

std::shared_ptr<bzn::storage_base> storage;

std::shared_ptr<bzn::storage_base> storage;

// Using 1 as first value here to distinguish from default value of 0 in protobuf
persistent<uint64_t> view{storage, uint64_t{1}, VIEW_KEY};
persistent<uint64_t> next_issued_sequence_number{storage, 1, NEXT_ISSUED_SEQUENCE_NUMBER_KEY};
Expand Down

0 comments on commit d18211b

Please sign in to comment.