Skip to content

Commit fafcad3

Browse files
author
MarcoFalke
committed
doc: Add testmempoolaccept to release-notes
1 parent 18815b4 commit fafcad3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

doc/release-notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ RPC changes
7474
add `label` fields to returned JSON objects that previously only had
7575
`account` fields.
7676
- `sendmany` now shuffles outputs to improve privacy, so any previously expected behavior with regards to output ordering can no longer be relied upon.
77+
- The new RPC `testmempoolaccept` can be used to test acceptance of a transaction to the mempool without adding it.
7778

7879
External wallet files
7980
---------------------

src/rpc/rawtransaction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ UniValue testmempoolaccept(const JSONRPCRequest& request)
11981198
{
11991199
LOCK(cs_main);
12001200
test_accept_res = AcceptToMemoryPool(mempool, state, std::move(tx), &missing_inputs,
1201-
nullptr /* plTxnReplaced */, false /* bypass_limits */, max_raw_tx_fee, /* test_accpet */ true);
1201+
nullptr /* plTxnReplaced */, false /* bypass_limits */, max_raw_tx_fee, /* test_accept */ true);
12021202
}
12031203
result_0.pushKV("allowed", test_accept_res);
12041204
if (!test_accept_res) {

src/validation.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ void UpdateMempoolForReorg(DisconnectedBlockTransactions &disconnectpool, bool f
507507

508508
// Used to avoid mempool polluting consensus critical paths if CCoinsViewMempool
509509
// were somehow broken and returning the wrong scriptPubKeys
510-
static bool CheckInputsFromMempoolAndCache(const CTransaction& tx, CValidationState &state, const CCoinsViewCache &view, CTxMemPool& pool,
510+
static bool CheckInputsFromMempoolAndCache(const CTransaction& tx, CValidationState& state, const CCoinsViewCache& view, const CTxMemPool& pool,
511511
unsigned int flags, bool cacheSigStore, PrecomputedTransactionData& txdata) {
512512
AssertLockHeld(cs_main);
513513

@@ -917,8 +917,7 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
917917
// invalid blocks (using TestBlockValidity), however allowing such
918918
// transactions into the mempool can be exploited as a DoS attack.
919919
unsigned int currentBlockScriptVerifyFlags = GetBlockScriptFlags(chainActive.Tip(), Params().GetConsensus());
920-
if (!CheckInputsFromMempoolAndCache(tx, state, view, pool, currentBlockScriptVerifyFlags, true, txdata))
921-
{
920+
if (!CheckInputsFromMempoolAndCache(tx, state, view, pool, currentBlockScriptVerifyFlags, true, txdata)) {
922921
// If we're using promiscuousmempoolflags, we may hit this normally
923922
// Check if current block has some flags that scriptVerifyFlags
924923
// does not before printing an ominous warning

0 commit comments

Comments
 (0)