aboutsummaryrefslogtreecommitdiff
path: root/include/hotstuff
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2018-08-03 17:22:34 -0400
committerDeterminant <[email protected]>2018-08-03 17:22:34 -0400
commit3e9f8b641e623054e50f69a5b41d85f8e65a2e13 (patch)
treee79f4ce93797954400a25976bfcdb3a627c884fe /include/hotstuff
parent745cb7a88baec540386f57edac7c84db889d63eb (diff)
...
Diffstat (limited to 'include/hotstuff')
-rw-r--r--include/hotstuff/liveness.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/hotstuff/liveness.h b/include/hotstuff/liveness.h
index c3d7d73..b8df8ef 100644
--- a/include/hotstuff/liveness.h
+++ b/include/hotstuff/liveness.h
@@ -174,7 +174,7 @@ class PMStickyProposer: virtual public PaceMaker {
} role;
double qc_timeout;
double candidate_timeout;
- EventContext eb;
+ EventContext ec;
/** QC timer or randomized timeout */
Event timer;
block_t last_proposed;
@@ -296,7 +296,7 @@ class PMStickyProposer: virtual public PaceMaker {
role = FOLLOWER;
proposer = new_proposer;
last_proposed = nullptr;
- timer = Event(eb, -1, 0, [this](int, short) {
+ timer = Event(ec, -1, 0, [this](int, short) {
/* unable to get a QC in time */
to_candidate();
});
@@ -315,7 +315,7 @@ class PMStickyProposer: virtual public PaceMaker {
role = PROPOSER;
proposer = hsc->get_id();
last_proposed = hsc->get_genesis();
- timer = Event(eb, -1, 0, [this](int, short) {
+ timer = Event(ec, -1, 0, [this](int, short) {
/* proposer unable to get a QC in time */
to_candidate();
});
@@ -330,7 +330,7 @@ class PMStickyProposer: virtual public PaceMaker {
role = CANDIDATE;
proposer = hsc->get_id();
last_proposed = nullptr;
- timer = Event(eb, -1, 0, [this](int, short) {
+ timer = Event(ec, -1, 0, [this](int, short) {
candidate_qc_timeout();
});
candidate_timeout = qc_timeout;
@@ -339,6 +339,9 @@ class PMStickyProposer: virtual public PaceMaker {
}
public:
+ PMStickyProposer(double qc_timeout, const EventContext &ec):
+ qc_timeout(qc_timeout), ec(ec) {}
+
void init(HotStuffCore *hsc) override {
PaceMaker::init(hsc);
to_candidate();
@@ -371,8 +374,8 @@ class PMStickyProposer: virtual public PaceMaker {
};
struct PaceMakerSticky: public PMAllParents, public PMStickyProposer {
- PaceMakerSticky(int32_t parent_limit):
- PMAllParents(parent_limit), PMStickyProposer() {}
+ PaceMakerSticky(int32_t parent_limit, double qc_timeout, EventContext eb):
+ PMAllParents(parent_limit), PMStickyProposer(qc_timeout, eb) {}
};
}