mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
[validation] Add CValidationState subclasses
Split CValidationState into TxValidationState and BlockValidationState to store validation results for transactions and blocks respectively.
This commit is contained in:
@@ -13,12 +13,12 @@
|
||||
#include <memory>
|
||||
|
||||
extern CCriticalSection cs_main;
|
||||
class BlockValidationState;
|
||||
class CBlock;
|
||||
class CBlockIndex;
|
||||
struct CBlockLocator;
|
||||
class CConnman;
|
||||
class CValidationInterface;
|
||||
class CValidationState;
|
||||
class uint256;
|
||||
class CScheduler;
|
||||
class CTxMemPool;
|
||||
@@ -134,11 +134,11 @@ protected:
|
||||
virtual void ChainStateFlushed(const CBlockLocator &locator) {}
|
||||
/**
|
||||
* Notifies listeners of a block validation result.
|
||||
* If the provided CValidationState IsValid, the provided block
|
||||
* If the provided BlockValidationState IsValid, the provided block
|
||||
* is guaranteed to be the current best block at the time the
|
||||
* callback was generated (not necessarily now)
|
||||
*/
|
||||
virtual void BlockChecked(const CBlock&, const CValidationState&) {}
|
||||
virtual void BlockChecked(const CBlock&, const BlockValidationState&) {}
|
||||
/**
|
||||
* Notifies listeners that a block which builds directly on our current tip
|
||||
* has been received and connected to the headers tree, though not validated yet */
|
||||
@@ -180,7 +180,7 @@ public:
|
||||
void BlockConnected(const std::shared_ptr<const CBlock> &, const CBlockIndex *pindex, const std::shared_ptr<const std::vector<CTransactionRef>> &);
|
||||
void BlockDisconnected(const std::shared_ptr<const CBlock> &);
|
||||
void ChainStateFlushed(const CBlockLocator &);
|
||||
void BlockChecked(const CBlock&, const CValidationState&);
|
||||
void BlockChecked(const CBlock&, const BlockValidationState&);
|
||||
void NewPoWValidBlock(const CBlockIndex *, const std::shared_ptr<const CBlock>&);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user