Timeline for How to get transaction fee from raw transaction?
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 5, 2018 at 21:35 | comment | added | Pieter Wuille | Expensive or impossible. Bitcoin Core can run in pruning mode, in which case it literally does not have that information anywhere. It would be highly unfortunate if people are forced to keep the whole blockchain around just to be able to compute fees. Using watch-only addresses to make the wallet track transactions you're interested in (including their fee information) is much more scalable. | |
Apr 5, 2018 at 20:58 | comment | added | Ava Chow♦ |
It can't be added to getrawtransaction as looking up that information for any arbitrary transaction is expensive. Bitcoin Core can do the lookup for new transactions which spends UTXOs. But once an output is spent, it becomes much more expensive to lookup that output, and maintaining a separate database for this is a waste of space and computational effort.
|
|
Apr 5, 2018 at 20:47 | comment | added | Tailer |
Yeah doing that over RPC is so expensive, if you could add input value for each input for getrawtransaction , could much better.
|
|
Apr 5, 2018 at 20:35 | vote | accept | Tailer | ||
Apr 5, 2018 at 20:34 | comment | added | Ava Chow♦ | Yes, but not in the way that you have to do it over RPC. Instead of pulling up each previous transaction, Bitcoin Core maintains an internal database of unspent transaction outputs. So it actually just pulls the UTXO from that database instead of pulling the transaction from the blockchain. | |
Apr 5, 2018 at 20:32 | comment | added | Pieter Wuille | @Adam as part of the validation rules, every full node needs to check that the fee of a transaction is not negative. So: yes, implicitly. | |
Apr 5, 2018 at 20:26 | comment | added | Tailer | Does bitcoin-core make this effort for each transaction to get transaction fee? | |
Apr 5, 2018 at 20:24 | history | answered | Ava Chow♦ | CC BY-SA 3.0 |