mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
doc: GetTransaction()/getrawtransaction follow-ups to #22383
This commit is contained in:
parent
abc57e1f08
commit
f685a13bef
2 changed files with 5 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue