diff options
author | John Newbery <john@johnnewbery.com> | 2021-07-22 20:32:04 +0200 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-07-22 20:35:14 +0200 |
commit | f685a13bef0418663015ea6d8f448f075510c0ec (patch) | |
tree | 5267f47ff785c1b0dac2a1b0bcec1a883d1bd2e4 | |
parent | abc57e1f0882a1a2bb20474648419979af6e383d (diff) |
doc: GetTransaction()/getrawtransaction follow-ups to #22383
-rw-r--r-- | src/node/transaction.cpp | 3 | ||||
-rw-r--r-- | src/rpc/rawtransaction.cpp | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/node/transaction.cpp b/src/node/transaction.cpp index 0227618edf..4de0b302e6 100644 --- a/src/node/transaction.cpp +++ b/src/node/transaction.cpp @@ -121,6 +121,9 @@ CTransactionRef GetTransaction(const CBlockIndex* const block_index, const CTxMe uint256 block_hash; if (g_txindex->FindTx(hash, block_hash, tx)) { if (!block_index || block_index->GetBlockHash() == block_hash) { + // Don't return the transaction if the provided block hash doesn't match. + // The case where a transaction appears in multiple blocks (e.g. reorgs or + // BIP30) is handled by the block lookup below. hashBlock = block_hash; return tx; } diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 30addf8af6..ed5e1d8c46 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -76,8 +76,8 @@ static RPCHelpMan getrawtransaction() "\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" + "If a blockhash argument is passed, it will return the transaction if\n" + "the specified block is available and the transaction is in that block.\n" "\nHint: Use gettransaction for wallet transactions.\n" "\nIf verbose is 'true', returns an Object with information about 'txid'.\n" |