Changeset View
Changeset View
Standalone View
Standalone View
src/validation.h
Show First 20 Lines • Show All 458 Lines • ▼ Show 20 Lines | |||||
/** Convert CValidationState to a human-readable message for logging */ | /** Convert CValidationState to a human-readable message for logging */ | ||||
std::string FormatStateMessage(const CValidationState &state); | std::string FormatStateMessage(const CValidationState &state); | ||||
/** | /** | ||||
* Count ECDSA signature operations the old-fashioned (pre-0.6) way | * Count ECDSA signature operations the old-fashioned (pre-0.6) way | ||||
* @return number of sigops this transaction's outputs will produce when spent | * @return number of sigops this transaction's outputs will produce when spent | ||||
* @see CTransaction::FetchInputs | * @see CTransaction::FetchInputs | ||||
*/ | */ | ||||
uint64_t GetSigOpCountWithoutP2SH(const CTransaction &tx); | uint64_t GetSigOpCountWithoutP2SH(const CTransaction &tx, uint32_t flags); | ||||
/** | /** | ||||
* Count ECDSA signature operations in pay-to-script-hash inputs. | * Count ECDSA signature operations in pay-to-script-hash inputs. | ||||
* | * | ||||
* @param[in] mapInputs Map of previous transactions that have outputs we're | * @param[in] mapInputs Map of previous transactions that have outputs we're | ||||
* spending | * spending | ||||
* @return maximum number of sigops required to validate this transaction's | * @return maximum number of sigops required to validate this transaction's | ||||
* inputs | * inputs | ||||
* @see CTransaction::FetchInputs | * @see CTransaction::FetchInputs | ||||
*/ | */ | ||||
uint64_t GetP2SHSigOpCount(const CTransaction &tx, | uint64_t GetP2SHSigOpCount(const CTransaction &tx, | ||||
const CCoinsViewCache &mapInputs); | const CCoinsViewCache &mapInputs, uint32_t flags); | ||||
/** | /** | ||||
* Compute total signature operation of a transaction. | * Compute total signature operation of a transaction. | ||||
* @param[in] tx Transaction for which we are computing the cost | * @param[in] tx Transaction for which we are computing the cost | ||||
* @param[in] inputs Map of previous transactions that have outputs we're | * @param[in] inputs Map of previous transactions that have outputs we're | ||||
* spending | * spending | ||||
* @param[out] flags Script verification flags | * @param[in] flags Script verification flags | ||||
* @return Total signature operation cost of tx | * @return Total signature operation cost of tx | ||||
*/ | */ | ||||
uint64_t GetTransactionSigOpCount(const CTransaction &tx, | uint64_t GetTransactionSigOpCount(const CTransaction &tx, | ||||
const CCoinsViewCache &inputs, int flags); | const CCoinsViewCache &inputs, | ||||
uint32_t flags); | |||||
/** | /** | ||||
* Check whether all inputs of this transaction are valid (no double spends, | * Check whether all inputs of this transaction are valid (no double spends, | ||||
* scripts & sigs, amounts). This does not modify the UTXO set. | * scripts & sigs, amounts). This does not modify the UTXO set. | ||||
* | * | ||||
* If pvChecks is not nullptr, script checks are pushed onto it instead of being | * If pvChecks is not nullptr, script checks are pushed onto it instead of being | ||||
* performed inline. Any script checks which are not necessary (eg due to script | * performed inline. Any script checks which are not necessary (eg due to script | ||||
* execution cache hits) are, obviously, not pushed onto pvChecks/run. | * execution cache hits) are, obviously, not pushed onto pvChecks/run. | ||||
Show All 19 Lines | |||||
* Apply the effects of this transaction on the UTXO set represented by view. | * Apply the effects of this transaction on the UTXO set represented by view. | ||||
*/ | */ | ||||
void UpdateCoins(CCoinsViewCache &view, const CTransaction &tx, int nHeight); | void UpdateCoins(CCoinsViewCache &view, const CTransaction &tx, int nHeight); | ||||
void UpdateCoins(CCoinsViewCache &view, const CTransaction &tx, CTxUndo &txundo, | void UpdateCoins(CCoinsViewCache &view, const CTransaction &tx, CTxUndo &txundo, | ||||
int nHeight); | int nHeight); | ||||
/** Transaction validation functions */ | /** Transaction validation functions */ | ||||
/** Context-independent validity checks for coinbase and non-coinbase | /** | ||||
* transactions */ | * Context-independent validity checks for coinbase and non-coinbase | ||||
* transactions. | |||||
*/ | |||||
bool CheckRegularTransaction(const CTransaction &tx, CValidationState &state, | bool CheckRegularTransaction(const CTransaction &tx, CValidationState &state, | ||||
bool fCheckDuplicateInputs = true); | bool fCheckDuplicateInputs = true); | ||||
bool CheckCoinbase(const CTransaction &tx, CValidationState &state, | bool CheckCoinbase(const CTransaction &tx, CValidationState &state, | ||||
bool fCheckDuplicateInputs = true); | bool fCheckDuplicateInputs = true); | ||||
namespace Consensus { | namespace Consensus { | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 223 Lines • Show Last 20 Lines |