Missing block height in listsinceblock and gettransaction #17296

issue BitBargain opened this issue on October 29, 2019
  1. BitBargain commented at 9:11 AM on October 29, 2019: none

    When using listsinceblock to fetch transactions since the last record observed, there is a relevant detail missed that I would like to record in the ledger: blockheight.

    It is unreasonable for my wallet interface to do an RPC lookup for every new blockhash just to get the height number. There could be hundreds of transactions or even thousands and they could all be processed with a simple call to listsinceblock if it wasn't for the lack of blockheight.

    Currently it looks like:

    "blockhash": "0000000000000000000549800794b27ab10d5e16ac6ad16a7c4a13dae756f80d", "blockindex": 1120, "blocktime": 1572073467,

    I would like it to look like:

    "blockhash": "0000000000000000000549800794b27ab10d5e16ac6ad16a7c4a13dae756f80d", "blockindex": 1120, "blocktime": 1572073467, "blockheight": 601091,

    I have the same request regarding the output of gettransaction also.

    Thanks in advance.

  2. BitBargain added the label Feature on Oct 29, 2019
  3. BitBargain renamed this:
    Listsinceblock does not include the block height for transactions
    Missing block height in listsinceblock and gettransaction
    on Oct 29, 2019
  4. ryanofsky commented at 9:28 PM on October 29, 2019: member

    This seems like a reasonable request, but it would definitely be interesting to know more about your use-case and what you'd use the heights for.

    #15931 starts caching block heights, so this could be implemented very efficiently after that

  5. BitBargain commented at 11:13 PM on October 29, 2019: none

    My use case currently is to store and audit wallet transactions in a database. The columns include some basics such as: date, category, amount, tx_fee, block_height, block_hash, etc.

    If listsinceblock resumes from an older state, many getblock transactions are done just to get the height where it's unknown (I do cache it, but when the wallet interface starts up and scans for any new tx's since the last block, there can be a couple of those). I think it's relevant to store as a basic attribute to any incoming transactions.

    It would really be nice not have to do so many lookups unnecessarily. That's all.

  6. laanwj added the label Wallet on Oct 30, 2019
  7. MarcoFalke closed this on Nov 12, 2019

  8. MarcoFalke locked this on Dec 16, 2021
  9. knst referenced this in commit b451b908bb on Apr 13, 2023
  10. knst referenced this in commit 380b4063d0 on Apr 15, 2023
  11. knst referenced this in commit 5f977b8bc0 on Apr 17, 2023
  12. UdjinM6 referenced this in commit bdf36f952b on Apr 17, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me