aboutsummaryrefslogtreecommitdiff
path: root/src/consensus.cpp
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2019-07-06 22:36:51 -0400
committerDeterminant <ted.sybil@gmail.com>2019-07-06 22:36:51 -0400
commitb5d5e8375373eaed6a5544860336a74bbd96446d (patch)
treebc37729f46e0c60804861ae9eb390697fdf1db43 /src/consensus.cpp
parent7a52e54b14eed096acce1c224ab46626f7c8cbaf (diff)
improve RR Pacemaker
Diffstat (limited to 'src/consensus.cpp')
-rw-r--r--src/consensus.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/consensus.cpp b/src/consensus.cpp
index 70c1876..d9c1f64 100644
--- a/src/consensus.cpp
+++ b/src/consensus.cpp
@@ -157,21 +157,12 @@ block_t HotStuffCore::on_propose(const std::vector<uint256_t> &cmds,
if (parents.empty())
throw std::runtime_error("empty parents");
for (const auto &_: parents) tails.erase(_);
- block_t p = parents[0];
- quorum_cert_bt qc = nullptr;
- block_t qc_ref = nullptr;
- /* a block can optionally carray a QC */
- if (p->voted.size() >= config.nmajority)
- {
- qc = p->self_qc->clone();
- qc_ref = p;
- }
/* create the new block */
block_t bnew = storage->add_blk(
new Block(parents, cmds,
- std::move(qc), std::move(extra),
- p->height + 1,
- qc_ref,
+ hqc.second->clone(), std::move(extra),
+ parents[0]->height + 1,
+ hqc.first,
nullptr
));
const uint256_t bnew_hash = bnew->get_hash();