lbrycrd/test/util
Daniel Kraft 57889e688d bitcoin-tx: Stricter check for valid integers
Just calling atoi to convert strings to integers does not check for
valid integers very thoroughly; in particular, it just ignores
everything starting from the first non-numeral character.  Even a string
like "foo" is fine and silently returns 0.

This meant that bitcoin-tx would not fail if such a string was passed in
various places where an integer is expected (like the locktime or an
input/output index); this means that it would, for instance, silently
accept a typo and interpret it in an unexpected way.

In this change, we use ParseInt64 for parsing strings to integers,
which actually verifies that the full string is valid as number.
New tests in the bitcoin-util-test cover the new error paths.
2018-07-07 14:25:09 +02:00
..
data bitcoin-tx: Stricter check for valid integers 2018-07-07 14:25:09 +02:00
bitcoin-util-test.py Explicitly specify encoding when opening text files in Python code 2018-06-12 21:34:52 +02:00
rpcauth-test.py Explicitly specify encoding when opening text files in Python code 2018-06-12 21:34:52 +02:00