CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
25 namespace catapult {
namespace chain {
33 #define CHAIN_COMPARISON_CODE_LIST \
35 ENUM_VALUE(Remote_Reported_Equal_Chain_Score, 1) \
38 ENUM_VALUE(Remote_Reported_Lower_Chain_Score, 2) \
41 ENUM_VALUE(Local_Chain_Score_Zero, 3) \
44 ENUM_VALUE(Remote_Is_Too_Far_Behind, Remote_Is_Out_Of_Sync_Flag | 1) \
47 ENUM_VALUE(Remote_Is_Not_Synced, Remote_Is_Out_Of_Sync_Flag | 2) \
50 ENUM_VALUE(Remote_Returned_Too_Many_Hashes, Remote_Is_Evil_Flag | 1) \
53 ENUM_VALUE(Remote_Is_Forked, Remote_Is_Evil_Flag | 2) \
56 ENUM_VALUE(Remote_Lied_About_Chain_Score, Remote_Is_Evil_Flag | 3)
58 #define ENUM_VALUE(LABEL, VALUE) LABEL = VALUE,
constexpr std::underlying_type_t< TEnum > to_underlying_type(TEnum value)
Converts a strongly typed enumeration value to its underlying integral value.
Definition: Casting.h:37
bool IsRemoteEvil(ChainComparisonCode code)
Gets a value indicating whether or not code indicates that the remote node is evil.
Definition: ChainComparisonCode.cpp:38
constexpr uint32_t Remote_Is_Evil_Flag
Chain comparison code flag that is set if the code indicates an evil remote node.
Definition: ChainComparisonCode.h:31
constexpr uint32_t Remote_Is_Out_Of_Sync_Flag
Chain comparison code flag that is set if the code indicates an out of sync remote node.
Definition: ChainComparisonCode.h:28
ChainComparisonCode
Possible chain comparison end states.
Definition: ChainComparisonCode.h:60
Definition: AddressExtractionExtension.cpp:28
bool IsRemoteOutOfSync(ChainComparisonCode code)
Gets a value indicating whether or not code indicates that the remote node is out of sync.
Definition: ChainComparisonCode.cpp:34
std::ostream & operator<<(std::ostream &out, ChainComparisonCode value)
Insertion operator for outputting value to out.