MetacoSA / QBitNinja

An Open Source and powerful blockchain API
MIT License
69 stars 42 forks source link

/balances "until" is not working properly #24

Open ozhelenkov opened 7 years ago

ozhelenkov commented 7 years ago

Hello,

Seems "until" parameter is not working properly for /balances request. If we understand correctly request: "/balances/address/until=block num" should return only transactions for mentioned address included in blocks from tip(latest block) until block num. Seems it is not working.

Here is example (our private blockchain). If needed we can try to find example on mainnet, but I believe example is OK.

  1. http://52.233.192.225/balances/2MuWdziH3irz1ssYvgMbLTZAds1Rtyij3Eh?colored=true We see here 5 transaction. Their blocks are: 37000, 37002, 37003, 37003, 37015

  2. http://52.233.192.225/balances/2MuWdziH3irz1ssYvgMbLTZAds1Rtyij3Eh?colored=true&until=37500 Trying to get balance change transaction later then 37500 block and for some reason instead of zero we see same 5 here. Height value has top block for some reason.

Please, correct me if we understand smth wrong.

Thanks a lot in advance!

NicolasDorier commented 7 years ago

if you can find me an instance of that happening on https://api.qbit.ninja/ I will take a look, I have not managed to reproduce.

ozhelenkov commented 7 years ago

Hi Nicolas! I have tried to find issue on your/our mainnet env and was not able too. I will add additional validation for that case to our prod env and in case the issue will appear I will inform you. Sorry for bothering and thx for fast repy.