diff options
author | glozow <gzhao408@berkeley.edu> | 2021-05-26 18:08:55 +0100 |
---|---|---|
committer | glozow <gzhao408@berkeley.edu> | 2021-06-02 09:40:39 +0100 |
commit | 6c5f19d9c4d267c54f4dbc4f9d65370ff1e0625b (patch) | |
tree | 9c7ec09b571939a750a1ca543dbbf90bec9f8504 /src/policy/packages.h | |
parent | 8115c2ad7dc87cc37662421875b728ffc29aaffd (diff) |
[package] static_assert max package size >= max tx size
Diffstat (limited to 'src/policy/packages.h')
-rw-r--r-- | src/policy/packages.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/policy/packages.h b/src/policy/packages.h index 4b1463dcb3..aef4066023 100644 --- a/src/policy/packages.h +++ b/src/policy/packages.h @@ -6,6 +6,7 @@ #define BITCOIN_POLICY_PACKAGES_H #include <consensus/validation.h> +#include <policy/policy.h> #include <primitives/transaction.h> #include <vector> @@ -14,6 +15,7 @@ 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}; +static_assert(MAX_PACKAGE_SIZE * WITNESS_SCALE_FACTOR * 1000 >= MAX_STANDARD_TX_WEIGHT); /** 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. |