From bca672b4d549e7fea43691ad387b003936ef2b8a Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 2 Jul 2019 15:13:28 -0400 Subject: fill zero for an unloaded uint256_t; other minor changes --- include/salticidae/network.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include/salticidae/network.h') diff --git a/include/salticidae/network.h b/include/salticidae/network.h index 4c5fea6..98fcd2a 100644 --- a/include/salticidae/network.h +++ b/include/salticidae/network.h @@ -1061,13 +1061,13 @@ PeerNetwork::get_peer_conn(const NetAddr &addr) const { if (it == known_peers.end()) throw PeerNetworkError(SALTI_ERROR_PEER_NOT_EXIST); if (it->second->peer_id.is_null()) - { conn = nullptr; - return; + else + { + auto it2 = pid2peer.find(it->second->peer_id); + assert(it2 != pid2peer.end()); + conn = it2->second->conn; } - auto it2 = pid2peer.find(it->second->peer_id); - assert(it2 != pid2peer.end()); - conn = it2->second->conn; } catch (...) { err = std::current_exception(); } @@ -1194,7 +1194,7 @@ template inline bool ClientNetwork::_send_msg(const Msg &msg, const NetAddr &addr) { auto it = addr2conn.find(addr); if (it == addr2conn.end()) - throw ClientNetworkError(SALTI_ERROR_PEER_NOT_EXIST); + throw ClientNetworkError(SALTI_ERROR_CLIENT_NOT_EXIST); return MsgNet::_send_msg(msg, it->second); } -- cgit v1.2.3