5 #ifndef BITCOIN_POLICY_PACKAGES_H 6 #define BITCOIN_POLICY_PACKAGES_H 15 #include <unordered_set> 25 static_assert(MAX_PACKAGE_WEIGHT >= MAX_STANDARD_TX_WEIGHT); 27 // Packages are part of a single cluster, so ensure that the package limits are 28 // set within the mempool's cluster size limits.
45 using Package = std::vector<CTransactionRef>;
92 #endif // BITCOIN_POLICY_PACKAGES_H static const int WITNESS_SCALE_FACTOR
The package itself is invalid (e.g. too many transactions).
Template for capturing information about block/transaction validation.
std::vector< CTransactionRef > Package
A package is an ordered list of transactions.
bool IsChildWithParentsTree(const Package &package)
Context-free check that a package IsChildWithParents() and none of the parents depend on each other (...
bool IsConsistentPackage(const Package &txns)
Checks that these transactions don't conflict, i.e., spend the same prevout.
PackageValidationResult
A "reason" why a package was invalid.
At least one tx is invalid.
bool IsWellFormedPackage(const Package &txns, PackageValidationState &state)
Context-free package policy checks:
static constexpr unsigned int DEFAULT_CLUSTER_SIZE_LIMIT_KVB
Maximum size of cluster in virtual kilobytes.
static constexpr unsigned int DEFAULT_CLUSTER_LIMIT
Maximum number of transactions per cluster (default)
static constexpr uint32_t MAX_PACKAGE_COUNT
Default maximum number of transactions in a package.
bool IsTopoSortedPackage(const Package &txns)
If any direct dependencies exist between transactions (i.e.
Initial value. The package has not yet been rejected.
uint256 GetPackageHash(const std::vector< CTransactionRef > &transactions)
Get the hash of the concatenated wtxids of transactions, with wtxids treated as a little-endian numbe...
bool IsChildWithParents(const Package &package)
Context-free check that a package is exactly one child and its parents; not all parents need to be pr...
static constexpr uint32_t MAX_PACKAGE_WEIGHT
Default maximum total weight of transactions in a package in weight to allow for context-less checks...