aboutsummaryrefslogtreecommitdiff
path: root/src/policy/packages.h
diff options
context:
space:
mode:
authorglozow <gzhao408@berkeley.edu>2021-06-02 16:19:29 +0100
committerglozow <gzhao408@berkeley.edu>2021-06-02 17:26:44 +0100
commitee862d6efb4c3c01e55f0d5d7a82cce75323cf40 (patch)
tree65d9325705de6dd20170cb36e778cf66716200e5 /src/policy/packages.h
parent5cac95cd15da04b83afa1d31a43be9f5b30a1827 (diff)
downloadbitcoin-ee862d6efb4c3c01e55f0d5d7a82cce75323cf40.tar.xz
MOVEONLY: context-free package policies
Co-authored-by: ariard <antoine.riard@gmail.com>
Diffstat (limited to 'src/policy/packages.h')
-rw-r--r--src/policy/packages.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/policy/packages.h b/src/policy/packages.h
index aef4066023..6b7ac3e450 100644
--- a/src/policy/packages.h
+++ b/src/policy/packages.h
@@ -33,4 +33,12 @@ using Package = std::vector<CTransactionRef>;
class PackageValidationState : public ValidationState<PackageValidationResult> {};
+/** Context-free package policy checks:
+ * 1. The number of transactions cannot exceed MAX_PACKAGE_COUNT.
+ * 2. The total virtual size cannot exceed MAX_PACKAGE_SIZE.
+ * 3. If any dependencies exist between transactions, parents must appear before children.
+ * 4. Transactions cannot conflict, i.e., spend the same inputs.
+ */
+bool CheckPackage(const Package& txns, PackageValidationState& state);
+
#endif // BITCOIN_POLICY_PACKAGES_H