aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2018-08-17 00:37:49 -0400
committerDeterminant <ted.sybil@gmail.com>2018-08-17 00:37:49 -0400
commitb10303fc8a043c6aef72f1437731835cdfb535c2 (patch)
treec3691f2f1df3dec442b1afe8ad7749b3cc4a889d /src
parent20500e74613f69f937e404cbabb3982da3b72881 (diff)
...
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,