aboutsummaryrefslogtreecommitdiff
path: root/src/policy
diff options
context:
space:
mode:
authorglozow <gzhao408@berkeley.edu>2021-04-05 11:13:27 -0700
committerglozow <gzhao408@berkeley.edu>2021-05-24 14:42:10 +0100
commitae8e6df709ff3d52b8e9918e09cacb64f83ae379 (patch)
treebfbd17da9d061c54cb724cada601096965fc8155 /src/policy
parentc9e1a26d1f17c8b98632b7796ffa8f8788b5a83c (diff)
downloadbitcoin-ae8e6df709ff3d52b8e9918e09cacb64f83ae379.tar.xz
[policy] limit package sizes
Maximum number of transactions allowed in a package is 25, equal to the default mempool descendant limit: if a package has more transactions than this, either it would fail default mempool descendant limit or the transactions don't all have a dependency relationship (but then they shouldn't be in a package together). Same rationale for 101KvB virtual size package limit. Note that these policies are only used in test accepts so far.
Diffstat (limited to 'src/policy')
-rw-r--r--src/policy/packages.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/policy/packages.h b/src/policy/packages.h
index 60aafb6d74..4b1463dcb3 100644
--- a/src/policy/packages.h
+++ b/src/policy/packages.h
@@ -10,6 +10,11 @@
#include <vector>
+/** Default maximum number of transactions in a package. */
+static constexpr uint32_t MAX_PACKAGE_COUNT{25};
+/** Default maximum total virtual size of transactions in a package in KvB. */
+static constexpr uint32_t MAX_PACKAGE_SIZE{101};
+
/** A "reason" why a package was invalid. It may be that one or more of the included
* transactions is invalid or the package itself violates our rules.
* We don't distinguish between consensus and policy violations right now.