in the version 0.18.0:
The getrawtransaction RPC & REST endpoints no longer check the unspent UTXO set for a transaction. The remaining behaviors are as follows: 1. If a blockhash is provided, check the corresponding block. 2. If no blockhash is provided, check the mempool. 3. If no blockhash is provided but txindex is enabled, also check txindex.
- I run pruned nodes for dev purposes. And i have problems:
- Here i explain why i walk on blockchain and use this call:
Whats wrong:
- without
txindexenabled,getrawtransactionare became worthless - to process wallet tx we need to do x2 more calls:
- use
gettransactionto get blockhash - then call
getrawtransaction(with blockhash) ordecoderawtransaction(with hash) to get rawtransaction body
- use
- to process non wallet transactions it completely fails :scream:
Here #16181 @MarcoFalke offers to decode rawtx data inside gettransaction. This is unuseful overload for an existing limited method (=api call what work only for in-wallet tx).
What i offer:
- Check the mempool and return if tx is found
- if
txindexenabled look for this tx and return tx or an error what tx not found - if
txindexdisabled look inside the data, stored on the node (pruneoptions) and return if tx is found or error message if tx not found
Like this we can use getrawtransaction to work with transactions on blockchain (fully or partially).
We store data, 4Gb or 8Gb - let the client use it!