PIVX Core  5.6.99
P2P Digital Currency
specialtx_validation.h
Go to the documentation of this file.
1  // Copyright (c) 2017 The Dash Core developers
2 // Copyright (c) 2020-2022 The PIVX Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef PIVX_EVO_SPECIALTX_VALIDATION_H
7 #define PIVX_EVO_SPECIALTX_VALIDATION_H
8 
10 #include "validation.h" // cs_main needed by CheckLLMQCommitment (!TODO: remove)
11 #include "version.h"
12 
13 class CBlock;
14 class CBlockIndex;
15 class CCoinsViewCache;
16 class CValidationState;
17 class CTransaction;
18 class uint256;
19 
21 static const unsigned int MAX_SPECIALTX_EXTRAPAYLOAD = 10000;
22 
24 // Note: for +v2, if the tx is not a special tx, this method returns true.
25 // Note2: This function only performs extra payload related checks, it does NOT checks regular inputs and outputs.
26 bool CheckSpecialTx(const CTransaction& tx, const CBlockIndex* pindexPrev, const CCoinsViewCache* view, CValidationState& state) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
27 
28 // Basic non-contextual checks for special txes
29 // Note: for +v2, if the tx is not a special tx, this method returns true.
31 
32 // Update internal tiertwo data when blocks containing special txes get connected/disconnected
33 bool ProcessSpecialTxsInBlock(const CBlock& block, const CBlockIndex* pindex, const CCoinsViewCache* view, CValidationState& state, bool fJustCheck) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
34 bool UndoSpecialTxsInBlock(const CBlock& block, const CBlockIndex* pindex);
35 
36 // Validate given LLMQ final commitment with the list at pindexQuorum
38 
40 
41 template <typename T>
42 bool GetValidatedTxPayload(const CTransaction& tx, T& obj, CValidationState& state);
43 
44 #endif // PIVX_EVO_SPECIALTX_VALIDATION_H
Definition: block.h:80
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition: chain.h:139
CCoinsView that adds a memory cache for transactions to another CCoinsView.
Definition: coins.h:283
The basic transaction that is broadcasted on the network and contained in blocks.
Definition: transaction.h:244
Capture information about block/transaction validation.
Definition: validation.h:24
256-bit opaque blob.
Definition: uint256.h:138
#define T(expected, seed, data)
RecursiveMutex cs_main
Global state.
Definition: validation.cpp:80
bool UndoSpecialTxsInBlock(const CBlock &block, const CBlockIndex *pindex)
bool CheckSpecialTx(const CTransaction &tx, const CBlockIndex *pindexPrev, const CCoinsViewCache *view, CValidationState &state) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Payload validity checks (including duplicate unique properties against list at pindexPrev)
bool ProcessSpecialTxsInBlock(const CBlock &block, const CBlockIndex *pindex, const CCoinsViewCache *view, CValidationState &state, bool fJustCheck) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
uint256 CalcTxInputsHash(const CTransaction &tx)
bool GetValidatedTxPayload(const CTransaction &tx, T &obj, CValidationState &state)
bool VerifyLLMQCommitment(const llmq::CFinalCommitment &qfc, const CBlockIndex *pindexPrev, CValidationState &state) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
bool CheckSpecialTxNoContext(const CTransaction &tx, CValidationState &state) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
#define EXCLUSIVE_LOCKS_REQUIRED(...)
Definition: threadsafety.h:50