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

[Docs] Small updates to getrawtransaction description #15332

Merged
merged 1 commit into from Feb 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions doc/release-notes.md
Expand Up @@ -254,11 +254,11 @@ in the Low-level Changes section below.

- See the [Mining](#mining) section for changes to `getblocktemplate`.

- The `getrawtransaction` RPC no longer checks the unspent UTXO set for
a transaction. The remaining behaviors are as follows: 1. If a
blockhash is provided, check the corresponding block. 2. If no
blockhash is provided, check the mempool. 3. If no blockhash is
provided but txindex is enabled, also check txindex.
- The `getrawtransaction` RPC & REST endpoints no longer check the
unspent UTXO set for a transaction. The remaining behaviors are as
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Perhaps this is fine in American English, but 'The remaining behaviors are...' sounds a little odd to me. 'The new behavior is...' sounds more natural.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I disagree, calling the behavior new seems misleading.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll let others comment. ACK either way.

follows: 1. If a blockhash is provided, check the corresponding block.
2. If no blockhash is provided, check the mempool. 3. If no blockhash
is provided but txindex is enabled, also check txindex.

Graphical User Interface (GUI)
------------------------------
Expand Down
16 changes: 10 additions & 6 deletions src/rpc/rawtransaction.cpp
@@ -1,5 +1,5 @@
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2018 The Bitcoin Core developers
// Copyright (c) 2009-2019 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

Expand Down Expand Up @@ -66,17 +66,21 @@ static UniValue getrawtransaction(const JSONRPCRequest& request)
{
if (request.fHelp || request.params.size() < 1 || request.params.size() > 3)
throw std::runtime_error(
RPCHelpMan{"getrawtransaction",
RPCHelpMan{
"getrawtransaction",
"\nReturn the raw transaction data.\n"

"\nBy default this function only works for mempool transactions. When called with a blockhash\n"
"argument, getrawtransaction will return the transaction if the specified block is available and\n"
"the transaction is found in that block. When called without a blockhash argument, getrawtransaction\n"
"will return the transaction if it is in the mempool, or if -txindex is enabled and the transaction\n"
"is in a block in the blockchain.\n"

"\nReturn the raw transaction data.\n"
"\nIf verbose is 'true', returns an Object with information about 'txid'.\n"
"If verbose is 'false' or omitted, returns a string that is serialized, hex-encoded data for 'txid'.\n"
,
"\nHint: use getmempoolentry to fetch a specific transaction from the mempool.\n"
"Or use gettransaction for wallet transactions.\n"

"\nIf verbose is 'true', returns an Object with information about 'txid'.\n"
"If verbose is 'false' or omitted, returns a string that is serialized, hex-encoded data for 'txid'.\n",
{
{"txid", RPCArg::Type::STR_HEX, /* opt */ false, /* default_val */ "", "The transaction id"},
{"verbose", RPCArg::Type::BOOL, /* opt */ true, /* default_val */ "false", "If false, return a string, otherwise return a json object"},
Expand Down