mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Merge #8329: Consensus: MOVEONLY: Move functions for tx verification
618d07f MOVEONLY: tx functions to consensus/tx_verify.o (Jorge Timón)
Tree-SHA512: 63fa2777c070a344dbfe61974526a770d962e049881c6f371b0034b1682c1e6e24f47454f01ee35ded20ade34488e023d4467a05369662906b99a73bb5de8497
This commit is contained in:
@@ -342,30 +342,6 @@ ThresholdState VersionBitsTipState(const Consensus::Params& params, Consensus::D
|
||||
/** Get the block height at which the BIP9 deployment switched into the state for the block building on the current tip. */
|
||||
int VersionBitsTipStateSinceHeight(const Consensus::Params& params, Consensus::DeploymentPos pos);
|
||||
|
||||
/**
|
||||
* Count ECDSA signature operations the old-fashioned (pre-0.6) way
|
||||
* @return number of sigops this transaction's outputs will produce when spent
|
||||
* @see CTransaction::FetchInputs
|
||||
*/
|
||||
unsigned int GetLegacySigOpCount(const CTransaction& tx);
|
||||
|
||||
/**
|
||||
* Count ECDSA signature operations in pay-to-script-hash inputs.
|
||||
*
|
||||
* @param[in] mapInputs Map of previous transactions that have outputs we're spending
|
||||
* @return maximum number of sigops required to validate this transaction's inputs
|
||||
* @see CTransaction::FetchInputs
|
||||
*/
|
||||
unsigned int GetP2SHSigOpCount(const CTransaction& tx, const CCoinsViewCache& mapInputs);
|
||||
|
||||
/**
|
||||
* Compute total signature operation cost of a transaction.
|
||||
* @param[in] tx Transaction for which we are computing the cost
|
||||
* @param[in] inputs Map of previous transactions that have outputs we're spending
|
||||
* @param[out] flags Script verification flags
|
||||
* @return Total signature operation cost of tx
|
||||
*/
|
||||
int64_t GetTransactionSigOpCost(const CTransaction& tx, const CCoinsViewCache& inputs, int flags);
|
||||
|
||||
/**
|
||||
* Check whether all inputs of this transaction are valid (no double spends, scripts & sigs, amounts)
|
||||
@@ -380,26 +356,6 @@ void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, int nHeight);
|
||||
|
||||
/** Transaction validation functions */
|
||||
|
||||
/** Context-independent validity checks */
|
||||
bool CheckTransaction(const CTransaction& tx, CValidationState& state, bool fCheckDuplicateInputs=true);
|
||||
|
||||
namespace Consensus {
|
||||
|
||||
/**
|
||||
* Check whether all inputs of this transaction are valid (no double spends and amounts)
|
||||
* This does not modify the UTXO set. This does not check scripts and sigs.
|
||||
* Preconditions: tx.IsCoinBase() is false.
|
||||
*/
|
||||
bool CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoinsViewCache& inputs, int nSpendHeight);
|
||||
|
||||
} // namespace Consensus
|
||||
|
||||
/**
|
||||
* Check if transaction is final and can be included in a block with the
|
||||
* specified height and time. Consensus critical.
|
||||
*/
|
||||
bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime);
|
||||
|
||||
/**
|
||||
* Check if transaction will be final in the next block to be created.
|
||||
*
|
||||
@@ -414,12 +370,6 @@ bool CheckFinalTx(const CTransaction &tx, int flags = -1);
|
||||
*/
|
||||
bool TestLockPointValidity(const LockPoints* lp);
|
||||
|
||||
/**
|
||||
* Check if transaction is final per BIP 68 sequence numbers and can be included in a block.
|
||||
* Consensus critical. Takes as input a list of heights at which tx's inputs (in order) confirmed.
|
||||
*/
|
||||
bool SequenceLocks(const CTransaction &tx, int flags, std::vector<int>* prevHeights, const CBlockIndex& block);
|
||||
|
||||
/**
|
||||
* Check if transaction will be BIP 68 final in the next block to be created.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user