Bitcoin ABC 0.32.4
P2P Digital Currency
tx_verify.h
Go to the documentation of this file.
1// Copyright (c) 2018-2020 The Bitcoin developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_CONSENSUS_TX_VERIFY_H
6#define BITCOIN_CONSENSUS_TX_VERIFY_H
7
8#include <kernel/cs_main.h>
9#include <threadsafety.h>
10
11#include <cstdint>
12#include <vector>
13
14struct Amount;
15class CBlockIndex;
16class CCoinsViewCache;
17class CTransaction;
19
20namespace Consensus {
21struct Params;
22
30bool CheckTxInputs(const CTransaction &tx, TxValidationState &state,
31 const CCoinsViewCache &inputs, int nSpendHeight,
32 Amount &txfee);
33
34} // namespace Consensus
35
43 const CTransaction &tx,
44 TxValidationState &state, int nHeight,
45 int64_t nMedianTimePast);
46
52 const CBlockIndex &active_chain_tip, const Consensus::Params &params,
53 const CTransaction &tx, TxValidationState &state)
55
62std::pair<int, int64_t> CalculateSequenceLocks(const CTransaction &tx,
63 int flags,
64 std::vector<int> &prevHeights,
65 const CBlockIndex &block);
66
67bool EvaluateSequenceLocks(const CBlockIndex &block,
68 std::pair<int, int64_t> lockPair);
69
75bool SequenceLocks(const CTransaction &tx, int flags,
76 std::vector<int> &prevHeights, const CBlockIndex &block);
77
78#endif // BITCOIN_CONSENSUS_TX_VERIFY_H
int flags
Definition: bitcoin-tx.cpp:542
const CChainParams & Params()
Return the currently selected parameters.
Definition: chainparams.cpp:21
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition: blockindex.h:25
CCoinsView that adds a memory cache for transactions to another CCoinsView.
Definition: coins.h:363
The basic transaction that is broadcasted on the network and contained in blocks.
Definition: transaction.h:192
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
Definition: cs_main.cpp:7
unsigned int nHeight
bool CheckTxInputs(const CTransaction &tx, TxValidationState &state, const CCoinsViewCache &inputs, int nSpendHeight, Amount &txfee)
Check whether all inputs of this transaction are valid (no double spends and amounts).
Definition: tx_verify.cpp:195
Definition: amount.h:19
Parameters that influence chain consensus.
Definition: params.h:34
#define EXCLUSIVE_LOCKS_REQUIRED(...)
Definition: threadsafety.h:56
bool ContextualCheckTransactionForCurrentBlock(const CBlockIndex &active_chain_tip, const Consensus::Params &params, const CTransaction &tx, TxValidationState &state)
Definition: tx_verify.cpp:73
bool EvaluateSequenceLocks(const CBlockIndex &block, std::pair< int, int64_t > lockPair)
Definition: tx_verify.cpp:177
bool SequenceLocks(const CTransaction &tx, int flags, std::vector< int > &prevHeights, const CBlockIndex &block)
Check if transaction is final per BIP 68 sequence numbers and can be included in a block.
Definition: tx_verify.cpp:188
bool ContextualCheckTransaction(const Consensus::Params &params, const CTransaction &tx, TxValidationState &state, int nHeight, int64_t nMedianTimePast)
Context dependent validity checks for non coinbase transactions.
Definition: tx_verify.cpp:42
bool ContextualCheckTransactionForCurrentBlock(const CBlockIndex &active_chain_tip, const Consensus::Params &params, const CTransaction &tx, TxValidationState &state) EXCLUSIVE_LOCKS_REQUIRED(std::pair< int, int64_t > CalculateSequenceLocks(const CTransaction &tx, int flags, std::vector< int > &prevHeights, const CBlockIndex &block)
This is a variant of ContextualCheckTransaction which computes the contextual check for a transaction...
Definition: tx_verify.h:62