Changeset View
Changeset View
Standalone View
Standalone View
src/validation.h
Show First 20 Lines • Show All 619 Lines • ▼ Show 20 Lines | |||||
* PreciousBlock() will override the effects of earlier calls. The effects of | * PreciousBlock() will override the effects of earlier calls. The effects of | ||||
* calls to PreciousBlock() are not retained across restarts. | * calls to PreciousBlock() are not retained across restarts. | ||||
* | * | ||||
* Returns true if the provided block index successfully became the chain tip. | * Returns true if the provided block index successfully became the chain tip. | ||||
*/ | */ | ||||
bool PreciousBlock(const Config &config, CValidationState &state, | bool PreciousBlock(const Config &config, CValidationState &state, | ||||
CBlockIndex *pindex); | CBlockIndex *pindex); | ||||
/** | |||||
* Mark a block as finalized. | |||||
* A finalized block can not be reorged in any way. | |||||
*/ | |||||
bool FinalizeBlock(const Config &config, CValidationState &state, | |||||
CBlockIndex *pindex); | |||||
/** Mark a block as invalid. */ | /** Mark a block as invalid. */ | ||||
bool InvalidateBlock(const Config &config, CValidationState &state, | bool InvalidateBlock(const Config &config, CValidationState &state, | ||||
CBlockIndex *pindex); | CBlockIndex *pindex); | ||||
/** Park a block. */ | /** Park a block. */ | ||||
bool ParkBlock(const Config &config, CValidationState &state, | bool ParkBlock(const Config &config, CValidationState &state, | ||||
CBlockIndex *pindex); | CBlockIndex *pindex); | ||||
Show All 36 Lines | |||||
/** | /** | ||||
* Determine what nVersion a new block should use. | * Determine what nVersion a new block should use. | ||||
*/ | */ | ||||
int32_t ComputeBlockVersion(const CBlockIndex *pindexPrev, | int32_t ComputeBlockVersion(const CBlockIndex *pindexPrev, | ||||
const Consensus::Params ¶ms); | const Consensus::Params ¶ms); | ||||
/** | /** | ||||
* Reject codes greater or equal to this can be returned by AcceptToMemPool for | * Reject codes greater or equal to this can be returned by AcceptToMemPool or | ||||
* transactions, to signal internal conditions. They cannot and should not be | * AcceptBlock for blocks/transactions, to signal internal conditions. They | ||||
* sent over the P2P network. | * cannot and should not be sent over the P2P network. | ||||
*/ | */ | ||||
static const unsigned int REJECT_INTERNAL = 0x100; | static const unsigned int REJECT_INTERNAL = 0x100; | ||||
/** Too high fee. Can not be triggered by P2P transactions */ | /** Too high fee. Can not be triggered by P2P transactions */ | ||||
static const unsigned int REJECT_HIGHFEE = 0x100; | static const unsigned int REJECT_HIGHFEE = 0x100; | ||||
/** Transaction is already known (either in mempool or blockchain) */ | /** Transaction is already known (either in mempool or blockchain) */ | ||||
static const unsigned int REJECT_ALREADY_KNOWN = 0x101; | static const unsigned int REJECT_ALREADY_KNOWN = 0x101; | ||||
/** Transaction conflicts with a transaction already known */ | /** Transaction conflicts with a transaction already known */ | ||||
static const unsigned int REJECT_CONFLICT = 0x102; | static const unsigned int REJECT_CONFLICT = 0x102; | ||||
/** Block conflicts with a transaction already known */ | |||||
static const unsigned int REJECT_AGAINST_FINALIZED = 0x103; | |||||
/** Get block file info entry for one block file */ | /** Get block file info entry for one block file */ | ||||
CBlockFileInfo *GetBlockFileInfo(size_t n); | CBlockFileInfo *GetBlockFileInfo(size_t n); | ||||
/** Dump the mempool to disk. */ | /** Dump the mempool to disk. */ | ||||
void DumpMempool(); | void DumpMempool(); | ||||
/** Load the mempool from disk. */ | /** Load the mempool from disk. */ | ||||
bool LoadMempool(const Config &config); | bool LoadMempool(const Config &config); | ||||
#endif // BITCOIN_VALIDATION_H | #endif // BITCOIN_VALIDATION_H |