From 4661ecc2ae1684cc02bde22215200e05b15ed4d7 Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 8 May 2019 15:23:47 -0400 Subject: reintroduce client confirms --- src/hotstuff_app.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/hotstuff_app.cpp') diff --git a/src/hotstuff_app.cpp b/src/hotstuff_app.cpp index b1776f5..bc596f4 100644 --- a/src/hotstuff_app.cpp +++ b/src/hotstuff_app.cpp @@ -78,9 +78,9 @@ class HotStuffApp: public HotStuff { /** The listen address for client RPC */ NetAddr clisten_addr; -#if HOTSTUFF_CMD_RESPSIZE > 0 +//#if HOTSTUFF_CMD_RESPSIZE > 0 std::unordered_map unconfirmed; -#endif +//#endif using conn_t = ClientNetwork::conn_t; @@ -102,25 +102,25 @@ class HotStuffApp: public HotStuff { #ifndef HOTSTUFF_ENABLE_BENCHMARK HOTSTUFF_LOG_INFO("replicated %s", std::string(fin).c_str()); #endif -#if HOTSTUFF_CMD_RESPSIZE > 0 +//#if HOTSTUFF_CMD_RESPSIZE > 0 auto it = unconfirmed.find(fin.cmd_hash); if (it != unconfirmed.end()) { it->second.resolve(fin); unconfirmed.erase(it); } -#endif +//#endif } -#ifdef HOTSTUFF_AUTOCLI - void do_demand_commands(size_t blk_size) override { - size_t ncli = client_conns.size(); - size_t bsize = (blk_size + ncli - 1) / ncli; - hotstuff::MsgDemandCmd mdc{bsize}; - for(const auto &conn: client_conns) - cn.send_msg(mdc, conn); - } -#endif +//#ifdef HOTSTUFF_AUTOCLI +// void do_demand_commands(size_t blk_size) override { +// size_t ncli = client_conns.size(); +// size_t bsize = (blk_size + ncli - 1) / ncli; +// hotstuff::MsgDemandCmd mdc{bsize}; +// for(const auto &conn: client_conns) +// cn.send_msg(mdc, conn); +// } +//#endif #ifdef HOTSTUFF_MSG_STAT std::unordered_set client_conns; @@ -313,7 +313,7 @@ void HotStuffApp::client_request_cmd_handler(MsgReqCmd &&msg, const conn_t &conn exec_command(cmd_hash).then([this, addr](Finality fin) { cn.send_msg(MsgRespCmd(fin), addr); }); -#if HOTSTUFF_CMD_RESPSIZE > 0 +//#if HOTSTUFF_CMD_RESPSIZE > 0 else { auto it = unconfirmed.find(cmd_hash); @@ -324,7 +324,7 @@ void HotStuffApp::client_request_cmd_handler(MsgReqCmd &&msg, const conn_t &conn cn.send_msg(MsgRespCmd(std::move(fin)), addr); }); } -#endif +//#endif } void HotStuffApp::start(const std::vector> &reps) { -- cgit v1.2.3-70-g09d2