Bitcoin ABC  0.22.13
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 <cstdint>
9 #include <vector>
10 
11 struct Amount;
12 class CBlockIndex;
13 class CCoinsViewCache;
14 class CTransaction;
15 class TxValidationState;
16 
17 namespace Consensus {
18 struct Params;
19 
27 bool CheckTxInputs(const CTransaction &tx, TxValidationState &state,
28  const CCoinsViewCache &inputs, int nSpendHeight,
29  Amount &txfee);
30 
31 } // namespace Consensus
32 
40  const CTransaction &tx,
41  TxValidationState &state, int nHeight,
42  int64_t nLockTimeCutoff,
43  int64_t nMedianTimePast);
44 
51 std::pair<int, int64_t> CalculateSequenceLocks(const CTransaction &tx,
52  int flags,
53  std::vector<int> &prevHeights,
54  const CBlockIndex &block);
55 
56 bool EvaluateSequenceLocks(const CBlockIndex &block,
57  std::pair<int, int64_t> lockPair);
58 
64 bool SequenceLocks(const CTransaction &tx, int flags,
65  std::vector<int> &prevHeights, const CBlockIndex &block);
66 
67 #endif // BITCOIN_CONSENSUS_TX_VERIFY_H
std::pair< int, int64_t > CalculateSequenceLocks(const CTransaction &tx, int flags, std::vector< int > &prevHeights, const CBlockIndex &block)
Calculates the block height and previous block&#39;s median time past at which the transaction will be co...
Definition: tx_verify.cpp:69
unsigned int nHeight
bool ContextualCheckTransaction(const Consensus::Params &params, const CTransaction &tx, TxValidationState &state, int nHeight, int64_t nLockTimeCutoff, int64_t nMedianTimePast)
Context dependent validity checks for non coinbase transactions.
Definition: tx_verify.cpp:40
Definition: amount.h:17
bool EvaluateSequenceLocks(const CBlockIndex &block, std::pair< int, int64_t > lockPair)
Definition: tx_verify.cpp:140
Parameters that influence chain consensus.
Definition: params.h:59
int flags
Definition: bitcoin-tx.cpp:529
The block chain is a tree shaped structure starting with the genesis block at the root...
Definition: blockindex.h:23
const CChainParams & Params()
Return the currently selected parameters.
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:151
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:158
The basic transaction that is broadcasted on the network and contained in blocks. ...
Definition: transaction.h:211
CCoinsView that adds a memory cache for transactions to another CCoinsView.
Definition: coins.h:231