GetTransaction should only use TxIndex if -txindex is set #15293

issue promag opened this issue on January 30, 2019
  1. promag commented at 3:22 PM on January 30, 2019: member

    Does it make sense to change the order and avoid locking cs_main or mempool.cs?

    Something like:

    bool GetTransaction(const uint256& hash, CTransactionRef& txOut, const Consensus::Params& consensusParams, uint256& hashBlock, const CBlockIndex* const block_index)
    {
        if (g_txindex) {
            return g_txindex->FindTx(hash, hashBlock, txOut);
        }
    
        LOCK(cs_main);
    
        ...
    

    I believe it would require to add some read-write mutex to TxIndex.

  2. promag cross-referenced this on Jan 30, 2019 from issue [RPC] Remove lookup to UTXO set from GetTransaction by amitiuttarwar
  3. MarcoFalke added the label Brainstorming on Jan 30, 2019
  4. MarcoFalke added the label Refactoring on Jan 30, 2019
  5. MarcoFalke added the label RPC/REST/ZMQ on Jan 30, 2019
  6. MarcoFalke commented at 10:29 AM on September 17, 2021: member

    @promag Is this still an issue?

  7. promag commented at 10:31 AM on September 17, 2021: member

    Done in #22383, thanks.

  8. promag closed this on Sep 17, 2021

  9. bitcoin locked this on Oct 30, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:54 UTC