aboutsummaryrefslogtreecommitdiff
path: root/include/hotstuff/client.h
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2018-07-18 21:44:40 -0400
committerDeterminant <[email protected]>2018-07-18 21:44:40 -0400
commit9e745354fe10f31b829f0c02a2aa464f391ffd19 (patch)
treeee2a3e22f128c9281a82a5069aa013af1fd1308f /include/hotstuff/client.h
parent70ab6576db5e49f7b2a38ea955e75328a6376812 (diff)
...
Diffstat (limited to 'include/hotstuff/client.h')
-rw-r--r--include/hotstuff/client.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/hotstuff/client.h b/include/hotstuff/client.h
index 2127595..87e60b7 100644
--- a/include/hotstuff/client.h
+++ b/include/hotstuff/client.h
@@ -17,20 +17,23 @@ enum {
struct Finality: public Serializable {
ReplicaID rid;
int8_t decision;
+ uint256_t cmd_hash;
uint256_t blk_hash;
public:
Finality() = default;
- Finality(ReplicaID rid, int8_t decision, uint256_t blk_hash):
- rid(rid), decision(decision), blk_hash(blk_hash) {}
+ Finality(ReplicaID rid, int8_t decision,
+ uint256_t cmd_hash, uint256_t blk_hash):
+ rid(rid), decision(decision),
+ cmd_hash(cmd_hash), blk_hash(blk_hash) {}
void serialize(DataStream &s) const override {
- s << rid << decision;
+ s << rid << decision << cmd_hash;
if (decision == 1) s << blk_hash;
}
void unserialize(DataStream &s) override {
- s >> rid >> decision;
+ s >> rid >> decision >> cmd_hash;
if (decision == 1) s >> blk_hash;
}
};
@@ -40,8 +43,8 @@ struct MsgClient: public salticidae::MsgBase<> {
void gen_reqcmd(const Command &cmd);
void parse_reqcmd(command_t &cmd, HotStuffCore *hsc) const;
- void gen_respcmd(const uint256_t &cmd_hash, const Finality &fin);
- void parse_respcmd(uint256_t &cmd_hash, Finality &fin) const;
+ void gen_respcmd(const Finality &fin);
+ void parse_respcmd(Finality &fin) const;
void gen_chkcmd(const uint256_t &cmd_hash);
void parse_chkcmd(uint256_t &cmd_hash) const;