-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Labels
Description
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
- did filter out txs that were below the target
- 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.