diff options
author | Determinant <[email protected]> | 2018-08-03 16:58:55 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2018-08-03 16:58:55 -0400 |
commit | 745cb7a88baec540386f57edac7c84db889d63eb (patch) | |
tree | 4ac7a2f23859f73719ab7ae748a27cd94644e017 /include | |
parent | 7d5b607f5e4efc4ab12a5cce49bd8198d8d03fe6 (diff) |
add pace maker option
Diffstat (limited to 'include')
-rw-r--r-- | include/hotstuff/hotstuff.h | 2 | ||||
-rw-r--r-- | include/hotstuff/liveness.h | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/include/hotstuff/hotstuff.h b/include/hotstuff/hotstuff.h index 41c83b4..b0a6827 100644 --- a/include/hotstuff/hotstuff.h +++ b/include/hotstuff/hotstuff.h @@ -128,7 +128,6 @@ class HotStuffBase: public HotStuffCore { size_t blk_size; /** libevent handle */ EventContext eb; - pacemaker_bt pmaker; private: /** whether libevent handle is owned by itself */ @@ -138,6 +137,7 @@ class HotStuffBase: public HotStuffCore { #ifdef HOTSTUFF_BLK_PROFILE BlockProfiler blk_profiler; #endif + pacemaker_bt pmaker; /* queues for async tasks */ std::unordered_map<const uint256_t, BlockFetchContext> blk_fetch_waiting; std::unordered_map<const uint256_t, BlockDeliveryContext> blk_delivery_waiting; diff --git a/include/hotstuff/liveness.h b/include/hotstuff/liveness.h index c87a242..c3d7d73 100644 --- a/include/hotstuff/liveness.h +++ b/include/hotstuff/liveness.h @@ -166,7 +166,7 @@ class PaceMakerDummyFixed: public PaceMakerDummy { * sees such new QC, if the QC is given by itself, it becomes the proposer, * otherwise yields to the creator of the QC as a follower. */ -class PMStickyProposer: public PMWaitQC { +class PMStickyProposer: virtual public PaceMaker { enum { PROPOSER, FOLLOWER, @@ -340,7 +340,7 @@ class PMStickyProposer: public PMWaitQC { public: void init(HotStuffCore *hsc) override { - PMWaitQC::init(hsc); + PaceMaker::init(hsc); to_candidate(); } @@ -370,6 +370,11 @@ class PMStickyProposer: public PMWaitQC { } }; +struct PaceMakerSticky: public PMAllParents, public PMStickyProposer { + PaceMakerSticky(int32_t parent_limit): + PMAllParents(parent_limit), PMStickyProposer() {} +}; + } #endif |