From c2ea6d1b65192983bdcee6f0db7cbfed053c9db8 Mon Sep 17 00:00:00 2001 From: joeywang4 Date: Wed, 13 Oct 2021 14:27:27 +0800 Subject: [PATCH] Ensure proposals are from the real proposer --- src/hotstuff.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hotstuff.cpp b/src/hotstuff.cpp index 591397c4..67632644 100644 --- a/src/hotstuff.cpp +++ b/src/hotstuff.cpp @@ -211,6 +211,11 @@ void HotStuffBase::propose_handler(MsgPropose &&msg, const Net::conn_t &conn) { LOG_WARN("invalid proposal from %d", prop.proposer); return; } + if (prop.proposer != pmaker->get_proposer()) + { + LOG_WARN("received proposal from %d who is not the proposer", prop.proposer); + return; + } promise::all(std::vector{ async_deliver_blk(blk->get_hash(), peer) }).then([this, prop = std::move(prop)]() {