mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
Merge #15477: doc: Remove misleading hint in getrawtransaction
9999879f56
refactor: Use RPCHelpMan::IsValidNumArgs in getrawtransaction (MarcoFalke)fa9ff8fe21
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:
commit
a0d4e79b4d
1 changed files with 8 additions and 7 deletions
|
@ -6,8 +6,8 @@
|
|||
#include <chain.h>
|
||||
#include <coins.h>
|
||||
#include <compat/byteswap.h>
|
||||
#include <consensus/validation.h>
|
||||
#include <consensus/tx_verify.h>
|
||||
#include <consensus/validation.h>
|
||||
#include <core_io.h>
|
||||
#include <index/txindex.h>
|
||||
#include <init.h>
|
||||
|
@ -67,9 +67,7 @@ static void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue&
|
|||
|
||||
static UniValue getrawtransaction(const JSONRPCRequest& request)
|
||||
{
|
||||
if (request.fHelp || request.params.size() < 1 || request.params.size() > 3)
|
||||
throw std::runtime_error(
|
||||
RPCHelpMan{
|
||||
const RPCHelpMan help{
|
||||
"getrawtransaction",
|
||||
"\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"
|
||||
"is in a block in the blockchain.\n"
|
||||
|
||||
"\nHint: use getmempoolentry to fetch a specific transaction from the mempool.\n"
|
||||
"Or use gettransaction for wallet transactions.\n"
|
||||
"\nHint: 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",
|
||||
|
@ -148,7 +145,11 @@ static UniValue getrawtransaction(const JSONRPCRequest& request)
|
|||
+ HelpExampleCli("getrawtransaction", "\"mytxid\" false \"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;
|
||||
uint256 hash = ParseHashV(request.params[0], "parameter 1");
|
||||
|
|
Loading…
Add table
Reference in a new issue