As mentioned in issue #30645:
Many command line parameter and RPC help texts currently contain the list of chain/network names hardcoded (“main, test, testnet4, signet, regtest”), which is error-prone as it can easily happen to miss an instance if the list ever changes again.
This PR deduplicates the list of possible chain/network strings in RPC/parameter help texts, and it creates a macro LIST_CHAIN_NAMES
in src/chainparamsbase.h. In the future, there is only 1 place where that list of possible values lives, so maintainability is improved and errors are avoided.
All three places where this change impacts:
0./bitcoin-cli --help
1./bitcoin-cli help getblockchaininfo
2./bitcoin-cli help getmininginfo
They all return the correct string "main, test, testnet4, signet, regtest"
See #30642 (review)