liststreamitems count and negative start: changing start to page but items being added

+1 vote

I'm wondering when using liststreamitems (actually all API calls with start and count) if we are using a negative start to page through the result set, what happens if additional stream items are being added. Would we be able to only retrieve the latest items added before a certain txid, key or timestamp?
asked May 11, 2017 by Steven

1 Answer

0 votes

If you're paging through a set of items that is growing, it's not a good idea to use a negative start value, because an offset from the last item will keep shifting. Instead, determine the total number of items using another API (e.g. liststreams stream1), and then page through using positive start values.

answered May 12, 2017 by MultiChain