From 3ffa282740c5eaeec246f8f4ae872bb31cf6eafa Mon Sep 17 00:00:00 2001 From: random-zebra Date: Mon, 10 May 2021 00:39:23 +0200 Subject: [PATCH] [RPC] Update getrawtransaction warning message --- src/rpc/rawtransaction.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index d4c73414d75d6..a5b526ff89fc3 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -133,9 +133,12 @@ UniValue getrawtransaction(const JSONRPCRequest& request) throw std::runtime_error( "getrawtransaction \"txid\" ( verbose \"blockhash\" )\n" - "\nNOTE: By default this function only works sometimes. This is when the tx is in the mempool\n" - "or there is an unspent output in the utxo for this transaction. To make it always work,\n" - "you need to maintain a transaction index, using the -txindex command line option.\n" + "\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" "\nReturn the raw transaction data.\n" "\nIf verbose is 'true', returns an Object with information about 'txid'.\n" @@ -151,7 +154,7 @@ UniValue getrawtransaction(const JSONRPCRequest& request) "\nResult (if verbose is set to true):\n" "{\n" - " \"in_active_chain\": b, (bool) Whether specified block is in the active chain or not (only present with explicit \"blockhash\" argument)\n" + " \"in_active_chain\": b, (bool) Whether specified block is in the active chain or not (only present with explicit \"blockhash\" argument)\n" " \"hex\" : \"data\", (string) The serialized, hex-encoded data for 'txid'\n" " \"txid\" : \"id\", (string) The transaction id (same as provided)\n" " \"size\" : n, (numeric) The serialized transaction size\n"