Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpc: Add testmempoolaccept #11742

Merged
merged 1 commit into from Apr 2, 2018
Merged

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Nov 21, 2017

To check if a single raw transaction makes it into the current transaction pool, one had to call sendrawtransaction. However, on success, this adds the transaction to the mempool with no easy way to undo.

The call testmempoolaccept is introduced to provide a way to solely check the result without changing the mempool state.

Copy link
Member

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should note that two equal calls to testmempoolaccept in a short period can return different values?

"\nAlso see sendrawtransaction call.\n"
"\nArguments:\n"
"1. \"hexstring\" (string, required) The hex string of the raw transaction)\n"
"2. allowhighfees (boolean, optional, default=false) Allow high fees\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix alignment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

UniValue result(UniValue::VOBJ);
result.push_back(Pair("hex", tx_hash.GetHex()));

{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO as it is this block is not needed.

bool is_tx_in_chain = !view.AccessCoin(COutPoint(tx_hash, o)).IsSpent();
if (is_tx_in_chain) {
result.push_back(Pair("allowed", false));
result.push_back(Pair("error", "transaction already in block chain"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add test?

@@ -4386,7 +4395,8 @@ bool LoadMempool(void)
if (nTime + nExpiryTimeout > nNow) {
LOCK(cs_main);
AcceptToMemoryPoolWithTime(chainparams, mempool, state, tx, nullptr /* pfMissingInputs */, nTime,
nullptr /* plTxnReplaced */, false /* bypass_limits */, 0 /* nAbsurdFee */);
nullptr /* plTxnReplaced */, false /* bypass_limits */, 0 /* nAbsurdFee */,
nullptr /* test_accept */);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already default value. Or remove default value from declaration?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note this is ATMPWT, not ATMP ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah!

@maflcko maflcko force-pushed the Mf1711-rpcMempoolAcceptOne branch 2 times, most recently from fa6f969 to e0c1f05 Compare November 22, 2017 18:20
@@ -998,6 +1078,7 @@ static const CRPCCommand commands[] =
{ "rawtransactions", "sendrawtransaction", &sendrawtransaction, {"hexstring","allowhighfees"} },
{ "rawtransactions", "combinerawtransaction", &combinerawtransaction, {"txs"} },
{ "rawtransactions", "signrawtransaction", &signrawtransaction, {"hexstring","prevtxs","privkeys","sighashtype"} }, /* uses wallet if enabled */
{ "rawtransactions", "testmempoolaccept", &testmempoolaccept, {"hexstring","allowhighfees"} },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space.

+ HelpExampleCli("createrawtransaction", "\"[{\\\"txid\\\" : \\\"mytxid\\\",\\\"vout\\\":0}]\" \"{\\\"myaddress\\\":0.01}\"") +
"Sign the transaction, and get back the hex\n"
+ HelpExampleCli("signrawtransaction", "\"myhex\"") +
"\nSend the transaction (signed hex)\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Send?

"{\n"
" \"hex\" (string) The transaction hash in hex\n"
" \"allowed\" (boolean) If the mempool allows this tx to be inserted\n"
" \"reject-reason\" (string) rejection string (if any)\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error? optional?

@maflcko maflcko force-pushed the Mf1711-rpcMempoolAcceptOne branch 2 times, most recently from 50ec02e to fa12a94 Compare December 6, 2017 01:49
Copy link
Member

@sipa sipa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK fa12a9481ea7d930c75f109f3c10b200db70e501

src/txmempool.h Outdated
@@ -578,7 +578,7 @@ class CTxMemPool
/** Populate setDescendants with all in-mempool descendants of hash.
* Assumes that setDescendants includes all in-mempool descendants of anything
* already in it. */
void CalculateDescendants(txiter it, setEntries &setDescendants);
void CalculateDescendants(const txiter it, setEntries& setDescendants) const;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This first const has no effect.

@NicolasDorier
Copy link
Contributor

I am so happy about this, big concept ACK. Some tests would be nice.

@jonasschnelli
Copy link
Contributor

Nice. Finally.
utACK fa12a9481ea7d930c75f109f3c10b200db70e501

A comment for the new parameter of AcceptToMemoryPool in validation.h would be nice.

Copy link
Contributor

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool.

"2. allowhighfees (boolean, optional, default=false) Allow high fees\n"
"\nResult:\n"
"{\n"
" \"hex\" (string) The transaction hash in hex\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems somewhat redundant to return the parameter as-is, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, will rename this to txid and the parameter to rawtx to make clear that they are different.

result.push_back(Pair("hex", tx_hash.GetHex()));

LOCK(cs_main);
const CCoinsViewCache& view = *pcoinsTip;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, I meannnnn, checking against pcoinsTip really sucks. Maybe just call ATMP and then check for the "txn-already-known" return? Or just return false (since its not "accepted to mempool", so I'd kinda expect that) and the rejection reason will be txn-already-known.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this was borrowed from sendrawtransaction.

There, there is an extra test bool fHaveMempool = mempool.exists(hashTx),
but it could be replaced by checking the ATMP error txn-already-in-mempool.

However in other PR I recall @sipa said it was kind of bad thing to rely on these rejection reasons.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is mostly a convenience check to provide a helpful message in case the tx recently confirmed for whatever reason. Otherwise you'd be left with missing_inputs, which is correct but might not be helpful at first.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a second thought, I don't think it makes sense to have the blockchain check here. Will return false as suggested by @TheBlueMatt

Copy link
Member

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you planning to add functional test in this PR?

"\nExamples:\n"
"\nCreate a transaction\n"
+ HelpExampleCli("createrawtransaction", "\"[{\\\"txid\\\" : \\\"mytxid\\\",\\\"vout\\\":0}]\" \"{\\\"myaddress\\\":0.01}\"") +
"Sign the transaction, and get back the hex\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing \n.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no new line to indicate a paragraph, which groups the rpcs into two logical sections.

"{\n"
" \"hex\" (string) The transaction hash in hex\n"
" \"allowed\" (boolean) If the mempool allows this tx to be inserted\n"
" \"reject-reason\" (string) rejection string (only present when 'allowed'==false)\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when 'allowed' is false

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx, fixed.

@maflcko maflcko force-pushed the Mf1711-rpcMempoolAcceptOne branch 7 times, most recently from a9bc799 to 293b972 Compare December 13, 2017 22:03
@maflcko
Copy link
Member Author

maflcko commented Dec 14, 2017

Removed the unused imports to make travis green.

@instagibbs
Copy link
Member

can someone remind me why this one is acceptable while the other ~dozen attempts have failed?

@NicolasDorier
Copy link
Contributor

@instagibbs Revelant history #7552 from @laanwj

I think this one can work because it has a better name. verifyrawtransaction is complex because there is lot's of bike-shed about the args and what verifying means. The meaning of testmempoolaccept is obvious and can't be misinterpreted, nor would it make sense to have more parameters.

Copy link
Member

@instagibbs instagibbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

} else if (missing_inputs) {
result.push_back(Pair("reject-reason", "Missing inputs"));
} else {
result.push_back(Pair("reject-reason", state.GetRejectReason()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand this is reflected in sendraw as well, but humor me: what times is state not IsInvalid but it would reject it?

@maflcko
Copy link
Member Author

maflcko commented Dec 19, 2017

@instagibbs Previous pulls were:

  • [WIP] [RPC] Add verifyrawtransaction RPC #11201: Solves the general case (a list of transactions), but ended up in a state of {WIP, needs review, will revisit later}. Haven't checked what is actually missing there.
  • rpc: Add verifyrawtransactions call #7552: Also solves the general case (a list of transactions), but tried to implement some tx pool checking logic in a separate function. Then people raised concerns that this might result in unwanted behavior. (I.e. verifytransaction tells you everything is fine, but your mempool rejects). Also ended in a state {WIP, needs review, will revisit later}...

I think this pull (testmempoolaccept) nicely exploits the existing checks for consensus/standardness that are called in ATMP, without touching too much of validation code. A future pull can extend this rpc to take lists of more than one raw transaction and feed them into an ephemeral mempool (e.g. based on the current mempool).

@greenaddress
Copy link
Contributor

conceptACK, seems useful and more accessible/convenient than current alternatives

// clang-format off
"testmempoolaccept [\"rawtxs\"] ( allowhighfees )\n"
"\nReturns if raw transaction (serialized, hex-encoded) would be accepted by mempool.\n"
"\nThis checks if the transaction violates our consesus or policy rules.\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type: consesus.

Nit, s/our/the.

"testmempoolaccept [\"rawtxs\"] ( allowhighfees )\n"
"\nReturns if raw transaction (serialized, hex-encoded) would be accepted by mempool.\n"
"\nThis checks if the transaction violates our consesus or policy rules.\n"
"\nAlso see sendrawtransaction call.\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, just See sendrawtransaction.


RPCTypeCheck(request.params, {UniValue::VARR, UniValue::VBOOL});
if (request.params[0].get_array().size() != 1) {
throw JSONRPCError(RPC_TYPE_ERROR, "Array must contain exactly one raw transaction for now");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RPC_INVALID_PARAMETER instead? Type is already correct (it's an array at least).

}

UniValue result(UniValue::VARR);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, remove empty line.

" {\n"
" \"txid\" (string) The transaction hash in hex\n"
" \"allowed\" (boolean) If the mempool allows this tx to be inserted\n"
" \"reject-reason\" (string) rejection string (only present when 'allowed' is false)\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, upper case Rejection.


ObserveSafeMode();

RPCTypeCheck(request.params, {UniValue::VARR, UniValue::VBOOL});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove? Below there is request.params[0].get_array() and request.params[1].get_bool().

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is the way we do it everywhere. I assume the rational is to fail early and provide useful feedback instead of accepting/processing each parameter separately and leaving any later ones unchecked.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error would be different thought. I don't think failing a bit later is that bad. This also doesn't work well with polymorphic arguments. At the end we have a mix of these, so I tend to use univalue getters to validate. We could add support to throw if any extra parameter is not get/validated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the error is different in that the RPCTypeCheck will tell you what the wrong type was, which is useful.
I fail to see how the edge case of polymorphic arguments is relevant to this pull request.

Copy link
Member

@promag promag Mar 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, missing test for second argument type and also tests for missing/extra arguments.

CValidationState state;
bool missing_inputs;
bool test_accept_res;
bool res = AcceptToMemoryPool(mempool, state, std::move(tx), &missing_inputs,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, we could avoid loose locks, I mean, it's more clear where the lock/unlock happens:

{
    LOCK(cs_main);
    bool res = AcceptToMemoryPool(...);
    assert(!res);
}

if (state.IsInvalid()) {
result_0.pushKV("reject-reason", strprintf("%i: %s", state.GetRejectCode(), state.GetRejectReason()));
} else if (missing_inputs) {
result_0.pushKV("reject-reason", "Missing inputs");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, not sure if relevant at all, but this format doesn't match with others. How about missing-inputs?

@maflcko
Copy link
Member Author

maflcko commented Dec 20, 2017

Added a commit to address @promag's feedback.

@laanwj
Copy link
Member

laanwj commented Feb 16, 2018

Concept ACK

@maflcko
Copy link
Member Author

maflcko commented Mar 29, 2018

I can do that refactoring in a follow up pr, if people think that is helpful.

@maflcko
Copy link
Member Author

maflcko commented Mar 30, 2018

Fun-Fact: I just realized an identical implementation was committed in gfanti@7148d4b a year ago. (Not including rpc changes and tests)

@instagibbs
Copy link
Member

utACK b55555d

@laanwj laanwj merged commit b55555d into bitcoin:master Apr 2, 2018
laanwj added a commit that referenced this pull request Apr 2, 2018
b55555d rpc: Add testmempoolaccept (MarcoFalke)

Pull request description:

  To check if a single raw transaction makes it into the current transaction pool, one had to call `sendrawtransaction`. However, on success, this adds the transaction to the mempool with no easy way to undo.

  The call `testmempoolaccept` is introduced to provide a way to solely check the result without changing the mempool state.

Tree-SHA512: 5afd9311190135cee8fc1f229c7d39bf893f1028f29e28d34f70df820198ff97b4bf86b41cbbd6e6c36a5c30073cefa92d541c74a4939c7a2a6fa283dfd41b63
@jamesob
Copy link
Member

jamesob commented Apr 2, 2018

Post-merge utACK b55555d

Change looks useful and well implemented. The tests are great! In some sense it's sad that the functional tests you've introduced for this particular RPC call are the only place where we're testing basic mempool rejection logic (e.g. scriptsig-not-pushonly, multi-op-return), but it's great that we've got explicit tests for those cases now.

@maflcko maflcko deleted the Mf1711-rpcMempoolAcceptOne branch April 2, 2018 15:10
@instagibbs
Copy link
Member

yes, forgot to mention the tests were very extensive and impressive

@jtimon
Copy link
Contributor

jtimon commented Apr 3, 2018

post merge fast review ack. +1 on this being interesting for the tests alone, even if nobody was going to use it (but I know some people will, and I remember concept acking something very similar before, for traceability, #7552 ).

laanwj added a commit that referenced this pull request Apr 7, 2018
fafcad3 doc: Add testmempoolaccept to release-notes (MarcoFalke)

Pull request description:

  Some fixups for #11742:

  * Add release notes for the new rpc
  * Fix a typo in the original pull
  * Make the mempool reference passed to `CheckInputsFromMempoolAndCache` const, since that function is called before we return from ATMP and we must not modify the mempool.

Tree-SHA512: 72c459ba69f7698a69c91d2592f10f7fb1864846c7d8c525050d48286f92ba5ec5fe554c54235b52fbd9a8f00226c526ad84584641ec39084e1a1310a261510d

RPCTypeCheck(request.params, {UniValue::VARR, UniValue::VBOOL});
if (request.params[0].get_array().size() != 1) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Array must contain exactly one raw transaction for now");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @MarcoFalke, sorry for the throwback, but was there a plan have testmempoolaccept accept multiple transactions at some point?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, see #11742 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fwiw i opened an issue to track this some time ago #18480 . Feel free to pick it up if you want (just signal it so we don't end up both working on it :) ), as i'm not going to work on this soon.

UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request May 21, 2021
b55555d rpc: Add testmempoolaccept (MarcoFalke)

Pull request description:

  To check if a single raw transaction makes it into the current transaction pool, one had to call `sendrawtransaction`. However, on success, this adds the transaction to the mempool with no easy way to undo.

  The call `testmempoolaccept` is introduced to provide a way to solely check the result without changing the mempool state.

Tree-SHA512: 5afd9311190135cee8fc1f229c7d39bf893f1028f29e28d34f70df820198ff97b4bf86b41cbbd6e6c36a5c30073cefa92d541c74a4939c7a2a6fa283dfd41b63
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request May 21, 2021
…ing const

fafcad3 doc: Add testmempoolaccept to release-notes (MarcoFalke)

Pull request description:

  Some fixups for bitcoin#11742:

  * Add release notes for the new rpc
  * Fix a typo in the original pull
  * Make the mempool reference passed to `CheckInputsFromMempoolAndCache` const, since that function is called before we return from ATMP and we must not modify the mempool.

Tree-SHA512: 72c459ba69f7698a69c91d2592f10f7fb1864846c7d8c525050d48286f92ba5ec5fe554c54235b52fbd9a8f00226c526ad84584641ec39084e1a1310a261510d
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request May 21, 2021
b55555d rpc: Add testmempoolaccept (MarcoFalke)

Pull request description:

  To check if a single raw transaction makes it into the current transaction pool, one had to call `sendrawtransaction`. However, on success, this adds the transaction to the mempool with no easy way to undo.

  The call `testmempoolaccept` is introduced to provide a way to solely check the result without changing the mempool state.

Tree-SHA512: 5afd9311190135cee8fc1f229c7d39bf893f1028f29e28d34f70df820198ff97b4bf86b41cbbd6e6c36a5c30073cefa92d541c74a4939c7a2a6fa283dfd41b63
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request May 21, 2021
…ing const

fafcad3 doc: Add testmempoolaccept to release-notes (MarcoFalke)

Pull request description:

  Some fixups for bitcoin#11742:

  * Add release notes for the new rpc
  * Fix a typo in the original pull
  * Make the mempool reference passed to `CheckInputsFromMempoolAndCache` const, since that function is called before we return from ATMP and we must not modify the mempool.

Tree-SHA512: 72c459ba69f7698a69c91d2592f10f7fb1864846c7d8c525050d48286f92ba5ec5fe554c54235b52fbd9a8f00226c526ad84584641ec39084e1a1310a261510d
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request May 21, 2021
b55555d rpc: Add testmempoolaccept (MarcoFalke)

Pull request description:

  To check if a single raw transaction makes it into the current transaction pool, one had to call `sendrawtransaction`. However, on success, this adds the transaction to the mempool with no easy way to undo.

  The call `testmempoolaccept` is introduced to provide a way to solely check the result without changing the mempool state.

Tree-SHA512: 5afd9311190135cee8fc1f229c7d39bf893f1028f29e28d34f70df820198ff97b4bf86b41cbbd6e6c36a5c30073cefa92d541c74a4939c7a2a6fa283dfd41b63
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request May 21, 2021
…ing const

fafcad3 doc: Add testmempoolaccept to release-notes (MarcoFalke)

Pull request description:

  Some fixups for bitcoin#11742:

  * Add release notes for the new rpc
  * Fix a typo in the original pull
  * Make the mempool reference passed to `CheckInputsFromMempoolAndCache` const, since that function is called before we return from ATMP and we must not modify the mempool.

Tree-SHA512: 72c459ba69f7698a69c91d2592f10f7fb1864846c7d8c525050d48286f92ba5ec5fe554c54235b52fbd9a8f00226c526ad84584641ec39084e1a1310a261510d
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request May 22, 2021
b55555d rpc: Add testmempoolaccept (MarcoFalke)

Pull request description:

  To check if a single raw transaction makes it into the current transaction pool, one had to call `sendrawtransaction`. However, on success, this adds the transaction to the mempool with no easy way to undo.

  The call `testmempoolaccept` is introduced to provide a way to solely check the result without changing the mempool state.

Tree-SHA512: 5afd9311190135cee8fc1f229c7d39bf893f1028f29e28d34f70df820198ff97b4bf86b41cbbd6e6c36a5c30073cefa92d541c74a4939c7a2a6fa283dfd41b63
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request May 22, 2021
…ing const

fafcad3 doc: Add testmempoolaccept to release-notes (MarcoFalke)

Pull request description:

  Some fixups for bitcoin#11742:

  * Add release notes for the new rpc
  * Fix a typo in the original pull
  * Make the mempool reference passed to `CheckInputsFromMempoolAndCache` const, since that function is called before we return from ATMP and we must not modify the mempool.

Tree-SHA512: 72c459ba69f7698a69c91d2592f10f7fb1864846c7d8c525050d48286f92ba5ec5fe554c54235b52fbd9a8f00226c526ad84584641ec39084e1a1310a261510d
kwvg pushed a commit to kwvg/dash that referenced this pull request May 25, 2021
b55555d rpc: Add testmempoolaccept (MarcoFalke)

Pull request description:

  To check if a single raw transaction makes it into the current transaction pool, one had to call `sendrawtransaction`. However, on success, this adds the transaction to the mempool with no easy way to undo.

  The call `testmempoolaccept` is introduced to provide a way to solely check the result without changing the mempool state.

Tree-SHA512: 5afd9311190135cee8fc1f229c7d39bf893f1028f29e28d34f70df820198ff97b4bf86b41cbbd6e6c36a5c30073cefa92d541c74a4939c7a2a6fa283dfd41b63
kwvg pushed a commit to kwvg/dash that referenced this pull request May 25, 2021
…ing const

fafcad3 doc: Add testmempoolaccept to release-notes (MarcoFalke)

Pull request description:

  Some fixups for bitcoin#11742:

  * Add release notes for the new rpc
  * Fix a typo in the original pull
  * Make the mempool reference passed to `CheckInputsFromMempoolAndCache` const, since that function is called before we return from ATMP and we must not modify the mempool.

Tree-SHA512: 72c459ba69f7698a69c91d2592f10f7fb1864846c7d8c525050d48286f92ba5ec5fe554c54235b52fbd9a8f00226c526ad84584641ec39084e1a1310a261510d
gades pushed a commit to cosanta/cosanta-core that referenced this pull request Apr 19, 2022
b55555d rpc: Add testmempoolaccept (MarcoFalke)

Pull request description:

  To check if a single raw transaction makes it into the current transaction pool, one had to call `sendrawtransaction`. However, on success, this adds the transaction to the mempool with no easy way to undo.

  The call `testmempoolaccept` is introduced to provide a way to solely check the result without changing the mempool state.

Tree-SHA512: 5afd9311190135cee8fc1f229c7d39bf893f1028f29e28d34f70df820198ff97b4bf86b41cbbd6e6c36a5c30073cefa92d541c74a4939c7a2a6fa283dfd41b63
gades pushed a commit to cosanta/cosanta-core that referenced this pull request Apr 29, 2022
…ing const

fafcad3 doc: Add testmempoolaccept to release-notes (MarcoFalke)

Pull request description:

  Some fixups for bitcoin#11742:

  * Add release notes for the new rpc
  * Fix a typo in the original pull
  * Make the mempool reference passed to `CheckInputsFromMempoolAndCache` const, since that function is called before we return from ATMP and we must not modify the mempool.

Tree-SHA512: 72c459ba69f7698a69c91d2592f10f7fb1864846c7d8c525050d48286f92ba5ec5fe554c54235b52fbd9a8f00226c526ad84584641ec39084e1a1310a261510d
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet