aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.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/txmempool.cpp
parent533660c58ad5a218671a9bc1537299b1d67bb55d (diff)
Bugfix: Pass correct virtual size to CheckPackageLimits
Diffstat (limited to 'src/txmempool.cpp')
-rw-r--r--src/txmempool.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index bedb57c13c..960be428c6 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -197,12 +197,11 @@ util::Result<CTxMemPool::setEntries> CTxMemPool::CalculateAncestorsAndCheckLimit
}
bool CTxMemPool::CheckPackageLimits(const Package& package,
+ const int64_t total_vsize,
std::string &errString) const
{
CTxMemPoolEntry::Parents staged_ancestors;
- int64_t total_size = 0;
for (const auto& tx : package) {
- total_size += GetVirtualTransactionSize(*tx);
for (const auto& input : tx->vin) {
std::optional<txiter> piter = GetIter(input.prevout.hash);
if (piter) {
@@ -217,7 +216,7 @@ bool CTxMemPool::CheckPackageLimits(const Package& package,
// When multiple transactions are passed in, the ancestors and descendants of all transactions
// considered together must be within limits even if they are not interdependent. This may be
// stricter than the limits for each individual transaction.
- const auto ancestors{CalculateAncestorsAndCheckLimits(total_size, package.size(),
+ const auto ancestors{CalculateAncestorsAndCheckLimits(total_vsize, package.size(),
staged_ancestors, m_limits)};
// It's possible to overestimate the ancestor/descendant totals.
if (!ancestors.has_value()) errString = "possibly " + util::ErrorString(ancestors).original;