NebulousLabs / Sia

Blockchain-based marketplace for file storage. Project has moved to GitLab: https://gitlab.com/NebulousLabs/Sia
https://sia.tech
MIT License
2.71k stars 442 forks source link

Change MaxUint64 to MaxInt64 in wallettransactionscmd #3102

Closed eddiewang closed 6 years ago

eddiewang commented 6 years ago

Changes math.MaxUint64 to math.MaxInt64 so that the handler does not overflow when running parseInt on the end height.

This bug showed up due to merging PR #3097 - which is a necessary modification to maintain -1 api compatibility with older versions of Sia-UI.

lukechampine commented 6 years ago

this makes me think that parsing as an int is probably the wrong thing to do. It wouldn't surprise me if a user assumed they could pass ^types.BlockHeight(0). Perhaps instead we should parse as a uint and check explicitly for FormValue("endheight") == "-1".

DavidVorick commented 6 years ago

Heh, do we want to make that change? I feel like it's the better choice as well.

Heights are always uint64, we should probably be checking the form value for a violation and then cleaning it up api-package side

ChrisSchinnerl commented 6 years ago

@DavidVorick Nope, we don't. That's why we already changed it in a new PR :P