mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-01 19:35:52 +02:00
Merge bitcoin/bitcoin#22383: rpc: Prefer to use txindex if available for GetTransaction
78f4c8b98eprefer to use txindex if available for GetTransaction (Jameson Lopp) Pull request description: Fixes #22382 Motivation: prevent excessive disk reads if txindex is enabled. Worth noting that this could be argued to be less of a bug and more of an issue of undefined behavior. If a user calls GetTransaction with the wrong block hash, what should happen? ACKs for top commit: jonatack: ACK78f4c8b98etheStack: Code review ACK78f4c8b98eLarryRuane: tACK78f4c8b98eluke-jr: utACK78f4c8b98ejnewbery: utACK78f4c8b98erajarshimaitra: Code review ACK78f4c8b98elsilva01: Code Review ACK and Tested ACK78f4c8b98eon Ubuntu 20.04 Tree-SHA512: af7db5b98cb2ae4897b28476b2fa243bf7e6f850750d9347062fe8013c5720986d1a3c808f80098e5289bd84b085de03c81a44e584dc28982f721c223651bfe0
This commit is contained in:
@@ -74,12 +74,10 @@ static RPCHelpMan getrawtransaction()
|
||||
"getrawtransaction",
|
||||
"\nReturn the raw transaction data.\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"
|
||||
|
||||
"\nBy default, this call only returns a transaction if it is in the mempool. If -txindex is enabled\n"
|
||||
"and no blockhash argument is passed, it will return the transaction if it is in the mempool or any block.\n"
|
||||
"If -txindex is not enabled and a blockhash argument is passed, it will return the transaction if\n"
|
||||
"the specified block is available and the transaction is found in that block.\n"
|
||||
"\nHint: Use gettransaction for wallet transactions.\n"
|
||||
|
||||
"\nIf verbose is 'true', returns an Object with information about 'txid'.\n"
|
||||
|
||||
Reference in New Issue
Block a user