aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2023-08-26 00:09:16 +0000
committerGreg Sanders <gsanders87@gmail.com>2023-09-20 08:13:18 -0400
commitbc013fe8e3d0bae2ab766a8248219aa3c9e344df (patch)
treef425ce366fea94e990ee24092151682d2f5f2258 /src/validation.cpp
parent533660c58ad5a218671a9bc1537299b1d67bb55d (diff)
downloadbitcoin-bc013fe8e3d0bae2ab766a8248219aa3c9e344df.tar.xz
Bugfix: Pass correct virtual size to CheckPackageLimits
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 8b5acf9ad1..db3310c2c3 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -634,6 +634,7 @@ private:
// Enforce package mempool ancestor/descendant limits (distinct from individual
// ancestor/descendant limits done in PreChecks).
bool PackageMempoolChecks(const std::vector<CTransactionRef>& txns,
+ int64_t total_vsize,
PackageValidationState& package_state) EXCLUSIVE_LOCKS_REQUIRED(cs_main, m_pool.cs);
// Run the script checks using our policy flags. As this can be slow, we should
@@ -1003,6 +1004,7 @@ bool MemPoolAccept::ReplacementChecks(Workspace& ws)
}
bool MemPoolAccept::PackageMempoolChecks(const std::vector<CTransactionRef>& txns,
+ const int64_t total_vsize,
PackageValidationState& package_state)
{
AssertLockHeld(cs_main);
@@ -1013,7 +1015,7 @@ bool MemPoolAccept::PackageMempoolChecks(const std::vector<CTransactionRef>& txn
{ return !m_pool.exists(GenTxid::Txid(tx->GetHash()));}));
std::string err_string;
- if (!m_pool.CheckPackageLimits(txns, err_string)) {
+ if (!m_pool.CheckPackageLimits(txns, total_vsize, err_string)) {
// This is a package-wide error, separate from an individual transaction error.
return package_state.Invalid(PackageValidationResult::PCKG_POLICY, "package-mempool-limits", err_string);
}
@@ -1298,7 +1300,7 @@ PackageMempoolAcceptResult MemPoolAccept::AcceptMultipleTransactions(const std::
// because it's unnecessary. Also, CPFP carve out can increase the limit for individual
// transactions, but this exemption is not extended to packages in CheckPackageLimits().
std::string err_string;
- if (txns.size() > 1 && !PackageMempoolChecks(txns, package_state)) {
+ if (txns.size() > 1 && !PackageMempoolChecks(txns, m_total_vsize, package_state)) {
return PackageMempoolAcceptResult(package_state, std::move(results));
}