Skip to content

Commit 3ffa282

Browse files
committed
[RPC] Update getrawtransaction warning message
1 parent 8d2207c commit 3ffa282

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/rpc/rawtransaction.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,12 @@ UniValue getrawtransaction(const JSONRPCRequest& request)
133133
throw std::runtime_error(
134134
"getrawtransaction \"txid\" ( verbose \"blockhash\" )\n"
135135

136-
"\nNOTE: By default this function only works sometimes. This is when the tx is in the mempool\n"
137-
"or there is an unspent output in the utxo for this transaction. To make it always work,\n"
138-
"you need to maintain a transaction index, using the -txindex command line option.\n"
136+
"\nNOTE: By default this function only works for mempool transactions. If the -txindex option is\n"
137+
"enabled, it also works for blockchain transactions. If the block which contains the transaction\n"
138+
"is known, its hash can be provided even for nodes without -txindex. Note that if a blockhash is\n"
139+
"provided, only that block will be searched and if the transaction is in the mempool or other\n"
140+
"blocks, or if this node does not have the given block available, the transaction will not be found.\n"
141+
"DEPRECATED: for now, it also works for transactions with unspent outputs.\n"
139142

140143
"\nReturn the raw transaction data.\n"
141144
"\nIf verbose is 'true', returns an Object with information about 'txid'.\n"
@@ -151,7 +154,7 @@ UniValue getrawtransaction(const JSONRPCRequest& request)
151154

152155
"\nResult (if verbose is set to true):\n"
153156
"{\n"
154-
" \"in_active_chain\": b, (bool) Whether specified block is in the active chain or not (only present with explicit \"blockhash\" argument)\n"
157+
" \"in_active_chain\": b, (bool) Whether specified block is in the active chain or not (only present with explicit \"blockhash\" argument)\n"
155158
" \"hex\" : \"data\", (string) The serialized, hex-encoded data for 'txid'\n"
156159
" \"txid\" : \"id\", (string) The transaction id (same as provided)\n"
157160
" \"size\" : n, (numeric) The serialized transaction size\n"

0 commit comments

Comments
 (0)