diff options
author | Determinant <ted.sybil@gmail.com> | 2019-05-08 15:23:47 -0400 |
---|---|---|
committer | Determinant <ted.sybil@gmail.com> | 2019-05-08 15:23:47 -0400 |
commit | 4661ecc2ae1684cc02bde22215200e05b15ed4d7 (patch) | |
tree | ecdf720754f4cf2d8081203bb3a2ad2484c433e6 /src/hotstuff_app.cpp | |
parent | 8e0a449961a7d78546dd09deb20f3b16bb460988 (diff) |
reintroduce client confirms
Diffstat (limited to 'src/hotstuff_app.cpp')
-rw-r--r-- | src/hotstuff_app.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
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<const uint256_t, promise_t> unconfirmed; -#endif +//#endif using conn_t = ClientNetwork<opcode_t>::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<conn_t> 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<std::pair<NetAddr, bytearray_t>> &reps) { |