Skip to content

Commit f685a13

Browse files
jnewberytheStack
authored andcommitted
doc: GetTransaction()/getrawtransaction follow-ups to #22383
1 parent abc57e1 commit f685a13

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/node/transaction.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ CTransactionRef GetTransaction(const CBlockIndex* const block_index, const CTxMe
121121
uint256 block_hash;
122122
if (g_txindex->FindTx(hash, block_hash, tx)) {
123123
if (!block_index || block_index->GetBlockHash() == block_hash) {
124+
// Don't return the transaction if the provided block hash doesn't match.
125+
// The case where a transaction appears in multiple blocks (e.g. reorgs or
126+
// BIP30) is handled by the block lookup below.
124127
hashBlock = block_hash;
125128
return tx;
126129
}

src/rpc/rawtransaction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ static RPCHelpMan getrawtransaction()
7676

7777
"\nBy default, this call only returns a transaction if it is in the mempool. If -txindex is enabled\n"
7878
"and no blockhash argument is passed, it will return the transaction if it is in the mempool or any block.\n"
79-
"If -txindex is not enabled and a blockhash argument is passed, it will return the transaction if\n"
80-
"the specified block is available and the transaction is found in that block.\n"
79+
"If a blockhash argument is passed, it will return the transaction if\n"
80+
"the specified block is available and the transaction is in that block.\n"
8181
"\nHint: Use gettransaction for wallet transactions.\n"
8282

8383
"\nIf verbose is 'true', returns an Object with information about 'txid'.\n"

0 commit comments

Comments
 (0)