CatapultServer  v0.5.0.1 (Elephant)
ChainComparisonCode.h File Reference
Include dependency graph for ChainComparisonCode.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 catapult
 
 catapult::chain
 

Macros

#define CHAIN_COMPARISON_CODE_LIST
 
#define ENUM_VALUE(LABEL, VALUE)   LABEL = VALUE,
 

Enumerations

enum  catapult::chain::ChainComparisonCode : uint32_t { catapult::chain::ChainComparisonCode::CHAIN_COMPARISON_CODE_LIST }
 Possible chain comparison end states. More...
 

Functions

std::ostream & catapult::chain::operator<< (std::ostream &out, ChainComparisonCode value)
 Insertion operator for outputting value to out. More...
 
bool catapult::chain::IsRemoteOutOfSync (ChainComparisonCode code)
 Gets a value indicating whether or not code indicates that the remote node is out of sync. More...
 
bool catapult::chain::IsRemoteEvil (ChainComparisonCode code)
 Gets a value indicating whether or not code indicates that the remote node is evil. More...
 

Variables

constexpr uint32_t catapult::chain::Remote_Is_Out_Of_Sync_Flag = 0x40000000
 Chain comparison code flag that is set if the code indicates an out of sync remote node. More...
 
constexpr uint32_t catapult::chain::Remote_Is_Evil_Flag = 0x80000000
 Chain comparison code flag that is set if the code indicates an evil remote node. More...
 

Macro Definition Documentation

◆ CHAIN_COMPARISON_CODE_LIST

#define CHAIN_COMPARISON_CODE_LIST
Value:
/* Remote and local nodes reported equal chain scores. */ \
ENUM_VALUE(Remote_Reported_Equal_Chain_Score, 1) \
\
/* Remote node reported a lower chain score than the local node. */ \
ENUM_VALUE(Remote_Reported_Lower_Chain_Score, 2) \
\
/* Local node has a chain score of zero indicating that it is not completely initialized. */ \
ENUM_VALUE(Local_Chain_Score_Zero, 3) \
\
/* Remote node is too far behind the local node. */ \
ENUM_VALUE(Remote_Is_Too_Far_Behind, Remote_Is_Out_Of_Sync_Flag | 1) \
\
/* Remote node is not in sync with the local node. */ \
ENUM_VALUE(Remote_Is_Not_Synced, Remote_Is_Out_Of_Sync_Flag | 2) \
\
/* Remote node returned too many hashes. */ \
ENUM_VALUE(Remote_Returned_Too_Many_Hashes, Remote_Is_Evil_Flag | 1) \
\
/* Remote node is on a fork. */ \
ENUM_VALUE(Remote_Is_Forked, Remote_Is_Evil_Flag | 2) \
\
/* Remote node lied about having a higher chain score. */ \
ENUM_VALUE(Remote_Lied_About_Chain_Score, Remote_Is_Evil_Flag | 3)

◆ ENUM_VALUE

#define ENUM_VALUE (   LABEL,
  VALUE 
)    LABEL = VALUE,
catapult::chain::Remote_Is_Evil_Flag
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
catapult::chain::Remote_Is_Out_Of_Sync_Flag
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