Skip to content

Commit 6c5f19d

Browse files
committed
[package] static_assert max package size >= max tx size
1 parent 8115c2a commit 6c5f19d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/policy/packages.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define BITCOIN_POLICY_PACKAGES_H
77

88
#include <consensus/validation.h>
9+
#include <policy/policy.h>
910
#include <primitives/transaction.h>
1011

1112
#include <vector>
@@ -14,6 +15,7 @@
1415
static constexpr uint32_t MAX_PACKAGE_COUNT{25};
1516
/** Default maximum total virtual size of transactions in a package in KvB. */
1617
static constexpr uint32_t MAX_PACKAGE_SIZE{101};
18+
static_assert(MAX_PACKAGE_SIZE * WITNESS_SCALE_FACTOR * 1000 >= MAX_STANDARD_TX_WEIGHT);
1719

1820
/** A "reason" why a package was invalid. It may be that one or more of the included
1921
* transactions is invalid or the package itself violates our rules.

0 commit comments

Comments
 (0)