diff options
author | Determinant <tederminant@gmail.com> | 2018-07-27 17:33:23 -0400 |
---|---|---|
committer | Determinant <tederminant@gmail.com> | 2018-07-27 17:33:23 -0400 |
commit | ec6a1f84324faf8e7c92f32137464db57410f58a (patch) | |
tree | 10a0f289a255eb5c78be2cb4a5e2702fc7995182 /src/hotstuff.cpp | |
parent | 5f00c067f863f812a740dc209b1fb829f04042eb (diff) |
fix signature verification bug
Diffstat (limited to 'src/hotstuff.cpp')
-rw-r--r-- | src/hotstuff.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
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<promise_t>{ async_deliver_blk(prop.bqc_hash, peer), async_deliver_blk(blk->get_hash(), peer), |