aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/consensus.cpp2
-rw-r--r--src/hotstuff.cpp2
-rw-r--r--src/hotstuff_client.cpp4
3 files changed, 5 insertions, 3 deletions
diff --git a/src/consensus.cpp b/src/consensus.cpp
index bf4868d..6b8b398 100644
--- a/src/consensus.cpp
+++ b/src/consensus.cpp
@@ -287,7 +287,7 @@ HotStuffCore::operator std::string () const {
<< "bexec=" << get_hex10(bqc->get_hash()) << " "
<< "vheight=" << std::to_string(vheight) << " "
<< "tails=" << std::to_string(tails.size()) << ">";
- return std::string(std::move(s));
+ return std::move(s);
}
}
diff --git a/src/hotstuff.cpp b/src/hotstuff.cpp
index 6230d06..a37e872 100644
--- a/src/hotstuff.cpp
+++ b/src/hotstuff.cpp
@@ -334,6 +334,7 @@ void HotStuffBase::print_stat() const {
part_delivery_time = 0;
part_delivery_time_min = double_inf;
part_delivery_time_max = 0;
+#ifdef HOTSTUFF_MSG_STAT
LOG_INFO("-- sent opcode (10s) --");
auto &sent_op = pn.get_sent_by_opcode();
for (auto &op: sent_op)
@@ -376,6 +377,7 @@ void HotStuffBase::print_stat() const {
LOG_INFO("sent: %lu", nsent);
LOG_INFO("recv: %lu", nrecv);
LOG_INFO("====== end stats ======");
+#endif
}
promise_t HotStuffBase::async_decide(const uint256_t &cmd_hash) {
diff --git a/src/hotstuff_client.cpp b/src/hotstuff_client.cpp
index f9bfb94..bee60c3 100644
--- a/src/hotstuff_client.cpp
+++ b/src/hotstuff_client.cpp
@@ -39,7 +39,7 @@ struct Request {
std::unordered_map<int, salticidae::RingBuffer> buffers;
std::unordered_map<const uint256_t, Request> waiting;
-MsgNetwork<MsgClient> mn(eb, 10, 0, 2, 4096);
+MsgNetwork<MsgClient> mn(eb, 10, 10, 4096);
std::unordered_map<ReplicaID, MsgNetwork<MsgClient>::conn_t> conns;
std::vector<NetAddr> replicas;
@@ -48,7 +48,7 @@ void set_proposer(ReplicaID rid) {
proposer = rid;
auto it = conns.find(rid);
if (it == conns.end())
- conns.insert(std::make_pair(rid, mn.create_conn(replicas[rid])));
+ conns.insert(std::make_pair(rid, mn.connect(replicas[rid])));
}
void try_send() {