rpc: add block timestamp and pagination to getaddressdeltas#453
Open
JSanchezFDZ wants to merge 1 commit into
Open
rpc: add block timestamp and pagination to getaddressdeltas#453JSanchezFDZ wants to merge 1 commit into
JSanchezFDZ wants to merge 1 commit into
Conversation
…m#434, Raptor3um#433) getaddressdeltas previously returned every historical delta with no block time, forcing callers to either run a second RPC per height or keep their own height-to-time map, and to trim large result sets client-side. - Add a "timestamp" field to each delta, resolved from the active chain index under cs_main (closes Raptor3um#434). - Add optional "skip"/"count" fields to the request object so callers can page through the height-ordered deltas instead of always pulling the full history (closes Raptor3um#433). Both default to the previous behaviour (skip=0, count=0 meaning unlimited) so existing callers are unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two related improvements to
getaddressdeltas, both backed by the addressindex and fully backward compatible.
Block timestamp (closes #434)
Each delta now includes a
timestampfield with the block time, resolvedfrom the active chain index under
cs_main. Previously callers had to runa second RPC per height (or keep their own height-to-time map) to learn
when a delta occurred.
Pagination (closes #433)
The request object accepts two new optional fields:
skip— number of leading deltas to drop (offset), default0count— maximum number of deltas to return, default0(unlimited)Pagination is applied over the asset-filtered, height-ordered set, so
callers can request just a slice instead of always pulling the entire
history and trimming it client-side. Defaults preserve the previous
behaviour, so existing integrations are unaffected.
Closes #434.
Closes #433.