From ec6a1f84324faf8e7c92f32137464db57410f58a Mon Sep 17 00:00:00 2001 From: Determinant Date: Fri, 27 Jul 2018 17:33:23 -0400 Subject: fix signature verification bug --- src/hotstuff.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/hotstuff.cpp') diff --git a/src/hotstuff.cpp b/src/hotstuff.cpp index 43da8a8..c01f2f3 100644 --- a/src/hotstuff.cpp +++ b/src/hotstuff.cpp @@ -53,13 +53,7 @@ void MsgRespBlock::postponed_parse(HotStuffCore *hsc) { { Block _blk; _blk.unserialize(serialized, hsc); - if (!_blk.verify(hsc->get_config())) - blk = hsc->storage->add_blk(std::move(_blk)); - else - { - blk = nullptr; - LOG_WARN("block is invalid"); - } + blk = hsc->storage->add_blk(std::move(_blk), hsc->get_config()); } } @@ -244,6 +238,7 @@ void HotStuffBase::propose_handler(MsgPropose &&msg, conn_t conn) { msg.postponed_parse(this); auto &prop = msg.proposal; block_t blk = prop.blk; + if (!blk) return; promise::all(std::vector{ async_deliver_blk(prop.bqc_hash, peer), async_deliver_blk(blk->get_hash(), peer), -- cgit v1.2.3-70-g09d2