From b10303fc8a043c6aef72f1437731835cdfb535c2 Mon Sep 17 00:00:00 2001 From: Determinant Date: Fri, 17 Aug 2018 00:37:49 -0400 Subject: ... --- src/consensus.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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 &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, -- cgit v1.2.3