mimblewimble / grin

Minimal implementation of the Mimblewimble protocol.
https://grin.mw/
Apache License 2.0
5.04k stars 991 forks source link

`get_blocks` API call - set tail height to include genesis #3773

Closed yeastplume closed 9 months ago

yeastplume commented 9 months ago

When calling the get_blocks function with a start height of 0, the start height is adjusted to the 'tail', or the earliest stored block. The tail function appears to be returning 1 in the case of an archive node, causing the call to skip block 0. This adjusts the start height in that single case to make the API more consistent.

pkariz commented 9 months ago

get_blocks is returning as expected now, thanks!