Fabcoin Core  0.16.2
P2P Digital Currency
tx_verify.h
Go to the documentation of this file.
1 // Copyright (c) 2017-2017 The Bitcoin Core 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 FABCOIN_CONSENSUS_TX_VERIFY_H
6 #define FABCOIN_CONSENSUS_TX_VERIFY_H
7 
8 #include <stdint.h>
9 #include <vector>
10 
11 class CBlockIndex;
12 class CCoinsViewCache;
13 class CTransaction;
14 class CValidationState;
15 
19 bool CheckTransaction(const CTransaction& tx, CValidationState& state, bool fCheckDuplicateInputs=true);
20 
21 namespace Consensus {
27 bool CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoinsViewCache& inputs, int nSpendHeight);
28 } // namespace Consensus
29 
37 unsigned int GetLegacySigOpCount(const CTransaction& tx);
38 
46 unsigned int GetP2SHSigOpCount(const CTransaction& tx, const CCoinsViewCache& mapInputs);
47 
55 int64_t GetTransactionSigOpCost(const CTransaction& tx, const CCoinsViewCache& inputs, int flags);
56 
61 bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime);
62 
69 std::pair<int, int64_t> CalculateSequenceLocks(const CTransaction &tx, int flags, std::vector<int>* prevHeights, const CBlockIndex& block);
70 
71 bool EvaluateSequenceLocks(const CBlockIndex& block, std::pair<int, int64_t> lockPair);
76 bool SequenceLocks(const CTransaction &tx, int flags, std::vector<int>* prevHeights, const CBlockIndex& block);
77 
78 #endif // FABCOIN_CONSENSUS_TX_VERIFY_H
bool CheckTxInputs(const CTransaction &tx, CValidationState &state, const CCoinsViewCache &inputs, int nSpendHeight)
Check whether all inputs of this transaction are valid (no double spends and amounts) This does not m...
Definition: tx_verify.cpp:224
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:104
unsigned int GetLegacySigOpCount(const CTransaction &tx)
Auxiliary functions for transaction validation (ideally should not be exposed)
Definition: tx_verify.cpp:109
unsigned int GetP2SHSigOpCount(const CTransaction &tx, const CCoinsViewCache &mapInputs)
Count ECDSA signature operations in pay-to-script-hash inputs.
Definition: tx_verify.cpp:123
bool CheckTransaction(const CTransaction &tx, CValidationState &state, bool fCheckDuplicateInputs=true)
Transaction validation functions.
Definition: tx_verify.cpp:161
bool EvaluateSequenceLocks(const CBlockIndex &block, std::pair< int, int64_t > lockPair)
Definition: tx_verify.cpp:94
int64_t GetTransactionSigOpCost(const CTransaction &tx, const CCoinsViewCache &inputs, int flags)
Compute total signature operation cost of a transaction.
Definition: tx_verify.cpp:140
bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime)
Check if transaction is final and can be included in a block with the specified height and time...
Definition: tx_verify.cpp:19
Capture information about block/transaction validation.
Definition: validation.h:27
The block chain is a tree shaped structure starting with the genesis block at the root...
Definition: chain.h:177
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:32
The basic transaction that is broadcasted on the network and contained in blocks. ...
Definition: transaction.h:275
CCoinsView that adds a memory cache for transactions to another CCoinsView.
Definition: coins.h:201