There are 3 ways through which main.cpp (and by extension, the getrawtransaction
and REST tx lookup) find transactions:
- In the mempool (works always)
- In the block index (works only when -txindex is enabled).
- In the UTXO set (inefficient, and only for confirmed transactions that have some of their outputs not yet spent by other confirmed transactions)
This third option is confusing because the conditions under which it works are complicated, and can make it seem like it always works even without -txindex. Remove it. If you need to call getrawtransaction
for confirmed transactions, you almost certainly need -txindex.
This only impacts the getrawtransaction
and REST tx calls, so document those.