Skip to content

Commit ce3e33c

Browse files
committed
Implement ignore_rejects for transaction packages
1 parent f433dad commit ce3e33c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/validation.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -504,10 +504,10 @@ class MemPoolAccept
504504

505505
/** Parameters for test package mempool validation through testmempoolaccept. */
506506
static ATMPArgs PackageTestAccept(const CChainParams& chainparams, int64_t accept_time,
507-
std::vector<COutPoint>& coins_to_uncache) {
507+
const ignore_rejects_type& ignore_rejects, std::vector<COutPoint>& coins_to_uncache) {
508508
return ATMPArgs{/* m_chainparams */ chainparams,
509509
/* m_accept_time */ accept_time,
510-
empty_ignore_rejects,
510+
/* m_ignore_rejects */ ignore_rejects,
511511
/* m_coins_to_uncache */ coins_to_uncache,
512512
/* m_test_accept */ true,
513513
/* m_allow_replacement */ false,
@@ -521,10 +521,10 @@ class MemPoolAccept
521521

522522
/** Parameters for child-with-unconfirmed-parents package validation. */
523523
static ATMPArgs PackageChildWithParents(const CChainParams& chainparams, int64_t accept_time,
524-
std::vector<COutPoint>& coins_to_uncache, const std::optional<CFeeRate>& client_maxfeerate) {
524+
std::vector<COutPoint>& coins_to_uncache, const std::optional<CFeeRate>& client_maxfeerate, const ignore_rejects_type& ignore_rejects) {
525525
return ATMPArgs{/* m_chainparams */ chainparams,
526526
/* m_accept_time */ accept_time,
527-
empty_ignore_rejects,
527+
/* m_ignore_rejects */ ignore_rejects,
528528
/* m_coins_to_uncache */ coins_to_uncache,
529529
/* m_test_accept */ false,
530530
/* m_allow_replacement */ true,
@@ -1920,7 +1920,7 @@ MempoolAcceptResult AcceptToMemoryPool(Chainstate& active_chainstate, const CTra
19201920
}
19211921

19221922
PackageMempoolAcceptResult ProcessNewPackage(Chainstate& active_chainstate, CTxMemPool& pool,
1923-
const Package& package, bool test_accept, const std::optional<CFeeRate>& client_maxfeerate)
1923+
const Package& package, bool test_accept, const std::optional<CFeeRate>& client_maxfeerate, const ignore_rejects_type& ignore_rejects)
19241924
{
19251925
AssertLockHeld(cs_main);
19261926
assert(!package.empty());
@@ -1931,10 +1931,10 @@ PackageMempoolAcceptResult ProcessNewPackage(Chainstate& active_chainstate, CTxM
19311931
auto result = [&]() EXCLUSIVE_LOCKS_REQUIRED(cs_main) {
19321932
AssertLockHeld(cs_main);
19331933
if (test_accept) {
1934-
auto args = MemPoolAccept::ATMPArgs::PackageTestAccept(chainparams, GetTime(), coins_to_uncache);
1934+
auto args = MemPoolAccept::ATMPArgs::PackageTestAccept(chainparams, GetTime(), ignore_rejects, coins_to_uncache);
19351935
return MemPoolAccept(pool, active_chainstate).AcceptMultipleTransactions(package, args);
19361936
} else {
1937-
auto args = MemPoolAccept::ATMPArgs::PackageChildWithParents(chainparams, GetTime(), coins_to_uncache, client_maxfeerate);
1937+
auto args = MemPoolAccept::ATMPArgs::PackageChildWithParents(chainparams, GetTime(), coins_to_uncache, client_maxfeerate, ignore_rejects);
19381938
return MemPoolAccept(pool, active_chainstate).AcceptPackage(package, args);
19391939
}
19401940
}();

src/validation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ static inline MempoolAcceptResult AcceptToMemoryPool(Chainstate& active_chainsta
291291
* possible for the package to be partially submitted.
292292
*/
293293
PackageMempoolAcceptResult ProcessNewPackage(Chainstate& active_chainstate, CTxMemPool& pool,
294-
const Package& txns, bool test_accept, const std::optional<CFeeRate>& client_maxfeerate)
294+
const Package& txns, bool test_accept, const std::optional<CFeeRate>& client_maxfeerate, const ignore_rejects_type& ignore_rejects=empty_ignore_rejects)
295295
EXCLUSIVE_LOCKS_REQUIRED(cs_main);
296296

297297
/* Mempool validation helper functions */

0 commit comments

Comments
 (0)