diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/consensus.cpp | 15 | ||||
-rw-r--r-- | src/hotstuff_client.cpp | 12 |
2 files changed, 3 insertions, 24 deletions
diff --git a/src/consensus.cpp b/src/consensus.cpp index 70c1876..d9c1f64 100644 --- a/src/consensus.cpp +++ b/src/consensus.cpp @@ -157,21 +157,12 @@ block_t HotStuffCore::on_propose(const std::vector<uint256_t> &cmds, if (parents.empty()) throw std::runtime_error("empty parents"); for (const auto &_: parents) tails.erase(_); - block_t p = parents[0]; - quorum_cert_bt qc = nullptr; - block_t qc_ref = nullptr; - /* a block can optionally carray a QC */ - if (p->voted.size() >= config.nmajority) - { - qc = p->self_qc->clone(); - qc_ref = p; - } /* create the new block */ block_t bnew = storage->add_blk( new Block(parents, cmds, - std::move(qc), std::move(extra), - p->height + 1, - qc_ref, + hqc.second->clone(), std::move(extra), + parents[0]->height + 1, + hqc.first, nullptr )); const uint256_t bnew_hash = bnew->get_hash(); diff --git a/src/hotstuff_client.cpp b/src/hotstuff_client.cpp index 7914125..831b7ff 100644 --- a/src/hotstuff_client.cpp +++ b/src/hotstuff_client.cpp @@ -108,18 +108,9 @@ void client_resp_cmd_handler(MsgRespCmd &&msg, const Net::conn_t &) { elapsed.push_back(std::make_pair(tv, et.elapsed_sec)); #endif waiting.erase(it); -#ifndef HOTSTUFF_AUTOCLI while (try_send()); -#endif } -//#ifdef HOTSTUFF_AUTOCLI -//void client_demand_cmd_handler(hotstuff::MsgDemandCmd &&msg, const Net::conn_t &) { -// for (size_t i = 0; i < msg.ncmd; i++) -// try_send(false); -//} -//#endif - std::pair<std::string, std::string> split_ip_port_cport(const std::string &s) { auto ret = salticidae::trim_all(salticidae::split(s, ";")); return std::make_pair(ret[0], ret[1]); @@ -141,9 +132,6 @@ int main(int argc, char **argv) { ev_sigterm.add(SIGTERM); mn.reg_handler(client_resp_cmd_handler); -//#ifdef HOTSTUFF_AUTOCLI -// mn.reg_handler(client_demand_cmd_handler); -//#endif mn.start(); config.add_opt("idx", opt_idx, Config::SET_VAL); |