aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDeterminant <tederminant@gmail.com>2018-08-07 17:27:57 -0400
committerDeterminant <tederminant@gmail.com>2018-08-07 17:27:57 -0400
commit062a1368abaa44585dcc4ea9b11e46708dbb418c (patch)
tree6ea1955ed1c81c93ee725c650fb4335454971afb /src
parent086e37788e16ddf62c0676a223002a3ea1b6d2e0 (diff)
sticky pace maker seems to work
Diffstat (limited to 'src')
-rw-r--r--src/consensus.cpp10
-rw-r--r--src/hotstuff_app.cpp2
2 files changed, 8 insertions, 4 deletions
diff --git a/src/consensus.cpp b/src/consensus.cpp
index 6505c20..58c0f31 100644
--- a/src/consensus.cpp
+++ b/src/consensus.cpp
@@ -173,7 +173,7 @@ void HotStuffCore::on_receive_proposal(const Proposal &prop) {
#ifdef HOTSTUFF_PROTO_LOG
LOG_INFO("now state: %s", std::string(*this).c_str());
#endif
- if (bnew->qc_ref) on_qc_finish(bnew);
+ if (bnew->qc_ref) on_qc_finish(bnew->qc_ref);
on_receive_proposal_(prop);
do_vote(prop.proposer,
Vote(id,
@@ -271,11 +271,15 @@ void HotStuffCore::on_qc_finish(const block_t &blk) {
}
promise_t HotStuffCore::async_wait_propose() {
- return propose_waiting;
+ return propose_waiting.then([](const block_t &blk) {
+ return blk;
+ });
}
promise_t HotStuffCore::async_wait_receive_proposal() {
- return receive_proposal_waiting;
+ return receive_proposal_waiting.then([](const Proposal &prop) {
+ return prop;
+ });
}
void HotStuffCore::on_propose_(const block_t &blk) {
diff --git a/src/hotstuff_app.cpp b/src/hotstuff_app.cpp
index 2b6e0db..3b65649 100644
--- a/src/hotstuff_app.cpp
+++ b/src/hotstuff_app.cpp
@@ -173,7 +173,7 @@ int main(int argc, char **argv) {
auto parent_limit = opt_parent_limit->get();
hotstuff::pacemaker_bt pmaker;
if (opt_pace_maker->get() == "sticky")
- pmaker = new hotstuff::PaceMakerSticky(parent_limit, 1, ec);
+ pmaker = new hotstuff::PaceMakerSticky(parent_limit, 5, ec);
else
pmaker = new hotstuff::PaceMakerDummyFixed(1, parent_limit);