Hey everybody,
when I read the help of bitcoin-core command
I get this ...
getrawtransaction "txid" ( verbosity "blockhash" )
By default, this call only returns a transaction if it is in the mempool. If -txindex is enabled
and no blockhash argument is passed, it will return the transaction if it is in the mempool or any block.
If a blockhash argument is passed, it will return the transaction if
the specified block is available and the transaction is in that block.
Hint: Use gettransaction for wallet transactions.
If verbosity is 0 or omitted, returns the serialized transaction as a hex-encoded string.
If verbosity is 1, returns a JSON Object with information about the transaction.
If verbosity is 2, returns a JSON Object with information about the transaction, including fee and prevout information.
Arguments:
1. txid (string, required) The transaction id
2. verbosity (numeric, optional, default=0) 0 for hex-encoded data, 1 for a JSON object, and 2 for JSON object with fee and prevout
3. blockhash (string, optional) The block in which to look for the transaction
I tried, and the result was not as expected. I used
getrawtransaction "abc123...TX...ID..." 0 <blockhash>
and the error was:
No such mempool transaction. Use -txindex or provide a block hash to enable blockchain transaction queries. Use gettransaction for wallet transactions. (code -5)
In my understanding, it should return the requested data when I provide the blockhash even my full-node does not utilize txindex=1
The error message that Bitcoin Core outputted says the same:
Either -txindex enabled
or block hash provided.
But it doesn't. I am running latest version, why does this not work? Is the help page outdated somehow? Of course, when I enable txindex I get the result but this is contrary to what the documentations and help page of that command shows.
citb0in