-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.
  • Thanks, it was InterpretBool I didn't find.
    – davidbak
    Dec 20 '17 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.