diff options
author | Determinant <ted.sybil@gmail.com> | 2020-02-25 16:16:33 -0500 |
---|---|---|
committer | Determinant <ted.sybil@gmail.com> | 2020-02-25 16:16:33 -0500 |
commit | 601fe38247a8232694a3c9af282c179e6ad1720d (patch) | |
tree | d72360651d73d67af6bc3bd51801b8fb1825d8e0 /include/hotstuff/entity.h | |
parent | 978f39fb6e01256d388bc295e4fd8138f20ef58f (diff) |
bump salticidae version and make some minor changes
Diffstat (limited to 'include/hotstuff/entity.h')
-rw-r--r-- | include/hotstuff/entity.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/include/hotstuff/entity.h b/include/hotstuff/entity.h index b3bf6a8..dea980d 100644 --- a/include/hotstuff/entity.h +++ b/include/hotstuff/entity.h @@ -39,20 +39,20 @@ enum EntityType { struct ReplicaInfo { ReplicaID id; - salticidae::NetAddr addr; + salticidae::PeerId peer_id; pubkey_bt pubkey; ReplicaInfo(ReplicaID id, - const salticidae::NetAddr &addr, + const salticidae::PeerId &peer_id, pubkey_bt &&pubkey): - id(id), addr(addr), pubkey(std::move(pubkey)) {} + id(id), peer_id(peer_id), pubkey(std::move(pubkey)) {} ReplicaInfo(const ReplicaInfo &other): - id(other.id), addr(other.addr), + id(other.id), peer_id(other.peer_id), pubkey(other.pubkey->clone()) {} ReplicaInfo(ReplicaInfo &&other): - id(other.id), addr(other.addr), + id(other.id), peer_id(other.peer_id), pubkey(std::move(other.pubkey)) {} }; @@ -82,8 +82,8 @@ class ReplicaConfig { return *(get_info(rid).pubkey); } - const salticidae::NetAddr &get_addr(ReplicaID rid) const { - return get_info(rid).addr; + const salticidae::PeerId &get_peer_id(ReplicaID rid) const { + return get_info(rid).peer_id; } }; @@ -101,7 +101,7 @@ class Command: public Serializable { virtual operator std::string () const { DataStream s; s << "<cmd id=" << get_hex10(get_hash()) << ">"; - return std::move(s); + return s; } }; @@ -113,7 +113,7 @@ get_hashes(const std::vector<Hashable> &plist) { std::vector<uint256_t> hashes; for (const auto &p: plist) hashes.push_back(p->get_hash()); - return std::move(hashes); + return hashes; } class Block { @@ -142,7 +142,7 @@ class Block { delivered(false), decision(0) {} Block(bool delivered, int8_t decision): - qc(nullptr), + qc(new QuorumCertDummy()), hash(salticidae::get_hash(*this)), qc_ref(nullptr), self_qc(nullptr), height(0), @@ -209,7 +209,7 @@ class Block { << "height=" << std::to_string(height) << " " << "parent=" << get_hex10(parent_hashes[0]) << " " << "qc_ref=" << (qc_ref ? get_hex10(qc_ref->get_hash()) : "null") << ">"; - return std::move(s); + return s; } }; |