aboutsummaryrefslogtreecommitdiff
path: root/src/hotstuff.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/hotstuff.cpp')
-rw-r--r--src/hotstuff.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/hotstuff.cpp b/src/hotstuff.cpp
index 9b36fa2..aeae2e2 100644
--- a/src/hotstuff.cpp
+++ b/src/hotstuff.cpp
@@ -85,10 +85,11 @@ promise_t HotStuffBase::exec_command(uint256_t cmd_hash) {
});
auto it = decision_waiting.find(cmd_hash);
+ promise_t pm{};
if (it == decision_waiting.end())
{
cmd_pending.push(cmd_hash);
- it = decision_waiting.insert(std::make_pair(cmd_hash, promise_t())).first;
+ it = decision_waiting.insert(std::make_pair(cmd_hash, pm)).first;
}
if (cmd_pending.size() >= blk_size)
@@ -117,7 +118,7 @@ promise_t HotStuffBase::exec_command(uint256_t cmd_hash) {
on_propose(cmds, pmaker->get_parents());
});
}
- return it->second;
+ return pm;
}
void HotStuffBase::on_fetch_blk(const block_t &blk) {