Bitcoin core txindex option - does it take argument or not? -txindex is documented (in multiple places) to take no (numeric) argument and that "default: 0".

Does this mean that you have to say -txindex=1 to set txindex, or does the mere appearance of -txindex on the command line set it to 1?

(IOW, is the value of the naked -txindex option 0 or 1?)
This is my interpretation from looking at the code.

First, -txindex is parsed, defaulting to false if it doesn't exist.

The argument is to -txindex interpreted as a boolean, which assumes no argument is the same as a true value (or else a non-zero argument is true).

So you do not need to provide an argument to -txindex, but if you do, it should be non-zero.


Don't provide -txindex: don't index
Provide -txindex with no argument: do index
Provide -txindex=0: don't index
Provide -txindex=1 (or any other non-zero value): do index.