HomePhabricator

Limit some options to only apply on mainnet when in default section

Authored by Anthony Towns <aj@erisian.com.au> on Apr 4 2018, 08:06.

Description

Limit some options to only apply on mainnet when in default section

Summary:
When specified in bitcoin.conf without using the [regtest] or [test]
section header, or a "regtest." or "test." prefix, the "addnode",
"connect", "port", "bind", "rpcport", "rpcbind", and "wallet" settings
will only be applied when running on mainnet.

When network-specific options such as -addnode, -connect, etc are
specified in the default section of the config file, but that setting is
ignored due to testnet or regtest being in use, and it is not overridden
by either a command line option or a setting in the [regtest] or [test]
section of the config file, a warning is added to the log, eg:

Warning: Config setting for -connect only applied on regtest network

when in [regtest] section.

Partial backport of core PR11862
Commits d1fc4d9, 68797e2 and 608415d

Depends on D2434

Test Plan:

make check

echo "rpcport=10042" > ~/.bitcoin/bitcoin.conf
./src/bitcoind -regtest

Check in ~/.bitcoin/regtest/debug.log that the warning is logged

Reviewers: #bitcoin_abc, deadalnix, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Subscribers: jasonbcox, teamcity, schancel

Differential Revision: https://reviews.bitcoinabc.org/D2435

Details

Committed
FabienFeb 5 2019, 07:57
Pushed
FabienFeb 5 2019, 07:58
Reviewer
Restricted Project
Differential Revision
D2435: Limit some options to only apply on mainnet when in default section
Parents
rABCf3a3fd103236: ArgsManager: support config file sections
Branches
Unknown
Tags
Unknown

Event Timeline