The new locale-independent atoi64 method introduced in #20452 parses large integer values higher than maximum representable value as 0 instead of the maximum value, which breaks backwards compatibility. This commit restores compatibility and adds test coverage for this case in terms of the related GetIntArg and strtoll functions.
Specifically, command line or bitcoin.conf integer values greater than 9223372036854775807
(2**63-1
) used to be parsed as 9223372036854775807
before #20452. Then #20452 caused them to be parsed as 0
. And after this PR they will be parsed as 9223372036854775807
again.
This change is a stripped-down alternative version of #23841 by jamesob