Page MenuHomePhabricator

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

Authored by Fabien on Tue, Jan 29, 15:08.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Tue, Jan 29, 15:08
Herald added a reviewer: Restricted Project. · View Herald TranscriptTue, Jan 29, 15:08
Herald added a subscriber: schancel. · View Herald Transcript
Fabien updated this revision to Diff 6987.Tue, Jan 29, 15:13

Complete release notes

jasonbcox accepted this revision.Tue, Jan 29, 19:29
jasonbcox added a subscriber: jasonbcox.
jasonbcox added inline comments.
src/util.cpp
177 ↗(On Diff #6987)

nit: comment style:

/**
 * Text on this line...
 * ...
 */
This revision is now accepted and ready to land.Tue, Jan 29, 19:29
Fabien updated this revision to Diff 6996.Tue, Jan 29, 19:31

Rebase

Closed by commit rABCe498befb04e9: Limit some options to only apply on mainnet when in default section (authored by Anthony Towns <aj@erisian.com.au>, committed by Fabien). · Explain WhyTue, Feb 5, 07:58
This revision was automatically updated to reflect the committed changes.