diff options
Diffstat (limited to 'include/hotstuff/entity.h')
-rw-r--r-- | include/hotstuff/entity.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/include/hotstuff/entity.h b/include/hotstuff/entity.h index 28b5148..1fca18c 100644 --- a/include/hotstuff/entity.h +++ b/include/hotstuff/entity.h @@ -80,9 +80,10 @@ class Command: public Serializable { virtual ~Command() = default; virtual const uint256_t &get_hash() const = 0; virtual bool verify() const = 0; - inline int8_t get_decision() const; - block_t get_container() const { - return container; + virtual operator std::string () const { + DataStream s; + s << "<cmd id=" << get_hex10(get_hash()) << ">"; + return std::move(s); } }; @@ -194,11 +195,6 @@ struct BlockHeightCmp { } }; -int8_t Command::get_decision() const { - block_t cptr = container; - return cptr ? cptr->get_decision() : 0; -} - class EntityStorage { std::unordered_map<const uint256_t, block_t> blk_cache; std::unordered_map<const uint256_t, command_t> cmd_cache; |