Skip to content

Target confirmations not intuitive in listsinceblock #14338

@kallewoof

Description

@kallewoof

The listsinceblock command's second argument

2. target_confirmations:    (numeric, optional, default=1) Return the nth block hash from the main chain. e.g. 1 would mean the best block hash. Note: this is not used as a filter, but only affects [lastblock] in the return value

does not seem to be very useful in its current form. What are the actual use cases here? (Harding pointed out the below on IRC)

Oh, maybe its just for parsing history backwards.  E.g. you're looking an the transactions
since block x and you want to get the block hash for x-1?
Doing that in a single RPC call over calling getblockhash keeps it atomic so that you don't
have to worry about a reorg between the listsinceblock call and the getblockhash call, I
guess.

It feels like it would make sense if this

  1. did filter out txs that were below the target
  2. did show txs that were below the target for arg 1 (blockhash), but were above the target for current block.

The above two changes would let someone create a simple starting point for only dealing with e.g. 6 confirmation transactions and not even have to bother with confirmation count since they'd never even see any transactions < target confs.

If not, the documentation is not very descriptive right now, and (despite having worked on the code for listsinceblock personally) I assumed things that weren't true about it, so it definitely needs a fix-up.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions