Merge #15477: doc: Remove misleading hint in getrawtransaction

9999879f56c88ca2837f5d18e6688917ba96e9e2 refactor: Use RPCHelpMan::IsValidNumArgs in getrawtransaction (MarcoFalke)
fa9ff8fe212ae40a1ef4980455bf916bc044fee2 doc: Remove misleading hint in getrawtransaction (MarcoFalke)

Pull request description:

  For 0.18.0

  I asked this line to be added in #15159, which was wrong because getmempoolentry does not return the raw transaction hex.

Tree-SHA512: 7ac85500c8192314347b7283cd369196bb959c124863642b6c1ce73d5662b1cbe4f42ded9c374dac6657458ab70b01810caf1235dd1d2b404bf376ebf09efa69
This commit is contained in:
Wladimir J. van der Laan 2019-02-27 12:21:18 +01:00
commit a0d4e79b4d
No known key found for this signature in database
GPG Key ID: 1E4AED62986CD25D

View File

@ -6,8 +6,8 @@
#include <chain.h> #include <chain.h>
#include <coins.h> #include <coins.h>
#include <compat/byteswap.h> #include <compat/byteswap.h>
#include <consensus/validation.h>
#include <consensus/tx_verify.h> #include <consensus/tx_verify.h>
#include <consensus/validation.h>
#include <core_io.h> #include <core_io.h>
#include <index/txindex.h> #include <index/txindex.h>
#include <init.h> #include <init.h>
@ -67,9 +67,7 @@ static void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue&
static UniValue getrawtransaction(const JSONRPCRequest& request) static UniValue getrawtransaction(const JSONRPCRequest& request)
{ {
if (request.fHelp || request.params.size() < 1 || request.params.size() > 3) const RPCHelpMan help{
throw std::runtime_error(
RPCHelpMan{
"getrawtransaction", "getrawtransaction",
"\nReturn the raw transaction data.\n" "\nReturn the raw transaction data.\n"
@ -79,8 +77,7 @@ static UniValue getrawtransaction(const JSONRPCRequest& request)
"will return the transaction if it is in the mempool, or if -txindex is enabled and the transaction\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" "is in a block in the blockchain.\n"
"\nHint: use getmempoolentry to fetch a specific transaction from the mempool.\n" "\nHint: Use gettransaction for wallet transactions.\n"
"Or use gettransaction for wallet transactions.\n"
"\nIf verbose is 'true', returns an Object with information about 'txid'.\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", "If verbose is 'false' or omitted, returns a string that is serialized, hex-encoded data for 'txid'.\n",
@ -148,7 +145,11 @@ static UniValue getrawtransaction(const JSONRPCRequest& request)
+ HelpExampleCli("getrawtransaction", "\"mytxid\" false \"myblockhash\"") + HelpExampleCli("getrawtransaction", "\"mytxid\" false \"myblockhash\"")
+ HelpExampleCli("getrawtransaction", "\"mytxid\" true \"myblockhash\"") + HelpExampleCli("getrawtransaction", "\"mytxid\" true \"myblockhash\"")
}, },
}.ToString()); };
if (request.fHelp || !help.IsValidNumArgs(request.params.size())) {
throw std::runtime_error(help.ToString());
}
bool in_active_chain = true; bool in_active_chain = true;
uint256 hash = ParseHashV(request.params[0], "parameter 1"); uint256 hash = ParseHashV(request.params[0], "parameter 1");