You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
wallet: decode raw transaction in gettransaction #16181
@MarcoFalke why do you want to improve a pretty limited api call (=only for wallet tx) instead of improving a call what exists and does much more? (getrawtransaction).
gettransaction "txid" ( include_watchonly )
Get detailed information about in-wallet transaction <txid>
With getrawtransaction i can look for ANY transaction i want:
Guess best improvements is to allow getrawtransaction to pickup a blockhash automatically from stored data (when users do not use txindex and use prune option).
@nikitasius Sorry, that's ridiculous. Without index, this means getrawtransaction could essily take minutes or hours to search through the blockchain for your transaction. If you need the data, add an index.
@nikitasius Sorry, that's ridiculous. Without index, this means getrawtransaction could essily take minutes or hours to search through the blockchain for your transaction. If you need the data, add an index.
@sipa thats why actual txindex should be reworked to be more flexy and more modern. Ridiculous is an actual getrawtransaction implementation what completely worthless on the nodes what prune the data.
Thats like:
hey folks, getrawtransaction was unsafe and buggy, but still worked for most of cases. Lets make it stable and ruin all what was build around.
it mean, what when someone run new bitcoin client with txindex and prune options, client build index using pruned data.
and each time when data is prunes, bitcoin client wipe from index pruned records.
@nikitasius Sorry, that's ridiculous. Without index, this means getrawtransaction could essily take minutes or hours to search through the blockchain for your transaction. If you need the data, add an index.
@sipa thats why actual txindex should be reworked to be more flexy and more modern. Ridiculous is an actual getrawtransaction implementation what completely worthless on the nodes what prune the data.
Thats like:
hey folks, getrawtransaction was unsafe and buggy, but still worked for most of cases. Lets make it stable and ruin all what was build around.
All is needed is a new re-org aware index (blockindex) that stores a mapping between the blockhash and txid (a simpler version of txindex) so things like getrawtransaction and gettransaction can do a simple lookup of a tx without storing all the transactions in the index like txindex does. With the rework of gettransaction (ability to pass in the hashBlock) the lookup becomes performant enough imo since its a disk read, most are on SSD's now aswell.
Even HDD not an issue, due new code can add index on fly (during loading new tx from blockchan), or run a heavily scan once if there are no index found for pruned data.
Much more useful to focus resources on this task instead of decoding raw tx in gettransaction call, due getrawtransaction have huge potencial and very universal and useful call.
The reason txindex isn't supported together with pruning is because we haven't heard of any use cases for (another) unreliable index. In my expectation, if you have a need to look up arbitrary transactions, you probably need them for the entire chain. Having it work for an ever-changing set of last few blocks is likely more confusing than helpful.
If you have a good use case for this, I'm all ears.
No objection to adding additional raw tx data to the wallet's gettransaction RPC method if users think that's useful. Discussion of changes to getrawtransaction should be discussed in #16182.
Activity
nikitasius commentedon Jun 10, 2019
@MarcoFalke why do you want to improve a pretty limited api call (=only for wallet tx) instead of improving a call what exists and does much more? (getrawtransaction).
With
getrawtransactioni can look for ANY transaction i want:Guess best improvements is to allow
getrawtransactionto pickup a blockhash automatically from stored data (when users do not use txindex and use prune option).promag commentedon Jun 10, 2019
How?
nikitasius commentedon Jun 10, 2019
If i store last 8Gb from blockchain on my node, client should be able to work with this 8Gb, otherwise i just waste my space for nothing.
Thats question to bitcoin devs, HOW they can manage/operate saved data.
sipa commentedon Jun 10, 2019
@nikitasius Sorry, that's ridiculous. Without index, this means
getrawtransactioncould essily take minutes or hours to search through the blockchain for your transaction. If you need the data, add an index.nikitasius commentedon Jun 10, 2019
@sipa thats why actual
txindexshould be reworked to be more flexy and more modern. Ridiculous is an actualgetrawtransactionimplementation what completely worthless on the nodes what prune the data.Thats like:
promag commentedon Jun 10, 2019
What you mean??
nikitasius commentedon Jun 10, 2019
it mean, what when someone run new bitcoin client with txindex and prune options, client build index using pruned data.
and each time when data is prunes, bitcoin client wipe from index pruned records.
promag commentedon Jun 10, 2019
What's the use case for a incomplete tx index? Anyway it's off topic here.
Concept ACK on decoded data for wallet transactions with a corresponding option.
sidhujag commentedon Jun 10, 2019
All is needed is a new re-org aware index (blockindex) that stores a mapping between the blockhash and txid (a simpler version of txindex) so things like getrawtransaction and gettransaction can do a simple lookup of a tx without storing all the transactions in the index like txindex does. With the rework of gettransaction (ability to pass in the hashBlock) the lookup becomes performant enough imo since its a disk read, most are on SSD's now aswell.
nikitasius commentedon Jun 10, 2019
@sidhujag exact.
Even HDD not an issue, due new code can add index on fly (during loading new tx from blockchan), or run a heavily scan once if there are no index found for pruned data.
Much more useful to focus resources on this task instead of decoding raw tx in
gettransactioncall, duegetrawtransactionhave huge potencial and very universal and useful call.sipa commentedon Jun 10, 2019
The reason txindex isn't supported together with pruning is because we haven't heard of any use cases for (another) unreliable index. In my expectation, if you have a need to look up arbitrary transactions, you probably need them for the entire chain. Having it work for an ever-changing set of last few blocks is likely more confusing than helpful.
If you have a good use case for this, I'm all ears.
jnewbery commentedon Jun 10, 2019
No objection to adding additional raw tx data to the wallet's
gettransactionRPC method if users think that's useful. Discussion of changes togetrawtransactionshould be discussed in #16182.Merge bitcoin#16185: gettransaction: add an argument to decode the tr…
Merge bitcoin#16185: gettransaction: add an argument to decode the tr…
Merge #16185: gettransaction: add an argument to decode the transaction