diff options
m--------- | salticidae | 0 | ||||
-rw-r--r-- | src/hotstuff.cpp | 13 | ||||
-rw-r--r-- | src/hotstuff_client.cpp | 2 |
3 files changed, 9 insertions, 6 deletions
diff --git a/salticidae b/salticidae -Subproject 051fb69b7e1bd321e4c780e35f92ea93828b520 +Subproject 53f776997d0e92650b9f3a16224cef1c0c76b71 diff --git a/src/hotstuff.cpp b/src/hotstuff.cpp index 5e75cc3..54b80e4 100644 --- a/src/hotstuff.cpp +++ b/src/hotstuff.cpp @@ -192,7 +192,8 @@ promise_t HotStuffBase::async_deliver_blk(const uint256_t &blk_hash, } void HotStuffBase::propose_handler(MsgPropose &&msg, const Net::conn_t &conn) { - const NetAddr &peer = conn->get_peer(); + const NetAddr &peer = conn->get_peer_addr(); + if (peer.is_null()) return; msg.postponed_parse(this); auto &prop = msg.proposal; block_t blk = prop.blk; @@ -205,7 +206,8 @@ void HotStuffBase::propose_handler(MsgPropose &&msg, const Net::conn_t &conn) { } void HotStuffBase::vote_handler(MsgVote &&msg, const Net::conn_t &conn) { - const NetAddr &peer = conn->get_peer(); + const NetAddr &peer = conn->get_peer_addr(); + if (peer.is_null()) return; msg.postponed_parse(this); //auto &vote = msg.vote; RcObj<Vote> v(new Vote(std::move(msg.vote))); @@ -221,7 +223,8 @@ void HotStuffBase::vote_handler(MsgVote &&msg, const Net::conn_t &conn) { } void HotStuffBase::req_blk_handler(MsgReqBlock &&msg, const Net::conn_t &conn) { - const NetAddr replica = conn->get_peer(); + const NetAddr replica = conn->get_peer_addr(); + if (replica.is_null()) return; auto &blk_hashes = msg.blk_hashes; std::vector<promise_t> pms; for (const auto &h: blk_hashes) @@ -341,8 +344,8 @@ HotStuffBase::HotStuffBase(uint32_t blk_size, } void HotStuffBase::do_broadcast_proposal(const Proposal &prop) { - MsgPropose prop_msg(prop); - pn.multicast_msg(prop_msg, peers); + //MsgPropose prop_msg(prop); + pn.multicast_msg(MsgPropose(prop), peers); //for (const auto &replica: peers) // pn.send_msg(prop_msg, replica); } diff --git a/src/hotstuff_client.cpp b/src/hotstuff_client.cpp index 2c8b738..08f2a2e 100644 --- a/src/hotstuff_client.cpp +++ b/src/hotstuff_client.cpp @@ -68,7 +68,7 @@ Net mn(ec, Net::Config()); void connect_all() { for (size_t i = 0; i < replicas.size(); i++) - conns.insert(std::make_pair(i, mn.connect(replicas[i]))); + conns.insert(std::make_pair(i, mn.connect_sync(replicas[i]))); } bool try_send(bool check = true) { |