| 1043 | } |
| 1044 | |
| 1045 | bool MemPoolAccept::PackageMempoolChecks(const std::vector<CTransactionRef>& txns, |
| 1046 | PackageValidationState& package_state) |
| 1047 | { |
| 1048 | AssertLockHeld(cs_main); |
| 1049 | AssertLockHeld(m_pool.cs); |
| 1050 | |
| 1051 | // CheckPackageLimits expects the package transactions to not already be in the mempool. |
| 1052 | assert(std::all_of(txns.cbegin(), txns.cend(), [this](const auto& tx) |
| 1053 | { return !m_pool.exists(GenTxid::Txid(tx->GetHash()));})); |
| 1054 | |
| 1055 | std::string err_string; |
| 1056 | if (!m_pool.CheckPackageLimits(txns, m_limit_ancestors, m_limit_ancestor_size, m_limit_descendants, |
| 1057 | m_limit_descendant_size, err_string)) { |
| 1058 | // This is a package-wide error, separate from an individual transaction error. |
| 1059 | return package_state.Invalid(PackageValidationResult::PCKG_POLICY, "package-mempool-limits", err_string); |
| 1060 | } |
| 1061 | return true; |
| 1062 | } |
| 1063 | |
| 1064 | bool MemPoolAccept::PolicyScriptChecks(const ATMPArgs& args, Workspace& ws) |
| 1065 | { |