Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid exceeding maximum safe Javascript integer
Some JSON libraries cannot parse integers greater than 2^53-1. So clamp "no limit" 2^64 sigop/sighash limits to 2^53-1 before returning them. A couple of implementation notes: Changing the constant returned by the consensus/params.h methods from uint64_t::max to 2^53-1 would be another fix, but that felt like a layering violation: the consensus code shouldn't care about details of representing numbers in JSON. Also, I didn't define JSON_NUMBER_LIMIT in a .h file because it isn't clear where it belongs (util.h? one of the json/ .h?) and because at this point it makes sense to try to create patches that change fewer files. Fixes issue# 45.
- Loading branch information