aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/rawtransaction.cpp
diff options
context:
space:
mode:
authorAmiti Uttarwar <amiti@uttarwar.org>2019-01-26 14:34:00 -0800
committerAmiti Uttarwar <amiti@uttarwar.org>2019-01-26 18:36:53 -0800
commit04da9f4834e1651da65ceb6379950cef9450591c (patch)
treec09a61a7b7223b0aff17834f5cf3094aa46b1e75 /src/rpc/rawtransaction.cpp
parenta9b71a09a0bbbdebc4c0b10d287bf2d53f628cf4 (diff)
downloadbitcoin-04da9f4834e1651da65ceb6379950cef9450591c.tar.xz
[RPC] Update getrawtransaction interface
Diffstat (limited to 'src/rpc/rawtransaction.cpp')
-rw-r--r--src/rpc/rawtransaction.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index bf00870107..6ccead2fdd 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -67,12 +67,11 @@ static UniValue getrawtransaction(const JSONRPCRequest& request)
if (request.fHelp || request.params.size() < 1 || request.params.size() > 3)
throw std::runtime_error(
RPCHelpMan{"getrawtransaction",
- "\nNOTE: By default this function only works for mempool transactions. If the -txindex option is\n"
- "enabled, it also works for blockchain transactions. If the block which contains the transaction\n"
- "is known, its hash can be provided even for nodes without -txindex. Note that if a blockhash is\n"
- "provided, only that block will be searched and if the transaction is in the mempool or other\n"
- "blocks, or if this node does not have the given block available, the transaction will not be found.\n"
- "DEPRECATED: for now, it also works for transactions with unspent outputs.\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"
@@ -175,7 +174,7 @@ static UniValue getrawtransaction(const JSONRPCRequest& request)
CTransactionRef tx;
uint256 hash_block;
- if (!GetTransaction(hash, tx, Params().GetConsensus(), hash_block, true, blockindex)) {
+ if (!GetTransaction(hash, tx, Params().GetConsensus(), hash_block, blockindex)) {
std::string errmsg;
if (blockindex) {
if (!(blockindex->nStatus & BLOCK_HAVE_DATA)) {
@@ -270,7 +269,7 @@ static UniValue gettxoutproof(const JSONRPCRequest& request)
if (pblockindex == nullptr)
{
CTransactionRef tx;
- if (!GetTransaction(oneTxid, tx, Params().GetConsensus(), hashBlock, false) || hashBlock.IsNull())
+ if (!GetTransaction(oneTxid, tx, Params().GetConsensus(), hashBlock) || hashBlock.IsNull())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Transaction not yet in block");
pblockindex = LookupBlockIndex(hashBlock);
if (!pblockindex) {