aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/consensus.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/consensus.cpp b/src/consensus.cpp
index 1c02585..d19d790 100644
--- a/src/consensus.cpp
+++ b/src/consensus.cpp
@@ -145,7 +145,8 @@ void HotStuffCore::on_propose(const std::vector<command_t> &cmds,
Proposal prop(id, bqc->get_hash(), bnew, nullptr);
LOG_PROTO("propose %s", std::string(*bnew).c_str());
/* self-vote */
- assert(bnew->height > vheight);
+ if (bnew->height <= vheight)
+ throw std::runtime_error("new block should be higher than vheight");
vheight = bnew->height;
on_receive_vote(
Vote(id, bqc->get_hash(), bnew_hash,