Merge #17447: wallet: Make -walletdir network only

3c2c439dcd wallet: Make -walletdir network only (João Barbosa)

Pull request description:

  With this PR `bitcoind -regtest` doesn't run if bitcoin.conf has
  ```
  walletdir=/mnt/mydisk/wallets
  ```
  But works with
  ```
  [regtest]
  walletdir=/mnt/mydisk/wallets
  ```

  Doesn't change mainnet behavior.

  Closes #15630.

ACKs for top commit:
  ryanofsky:
    ACK 3c2c439dcd
  MarcoFalke:
    ACK 3c2c439dcd 🍈
  meshcollider:
    Tested ACK 3c2c439dcd

Tree-SHA512: 8ab3b2db5f3f9cab78b36baaf490c80f7330372cfd8f73fe6536c8fb4c6e55e09f62296feb70617075838b3bcd7101abebbef3b228b6c3dbd42ce8c7a5c372d9
This commit is contained in:
Samuel Dobson 2019-11-23 10:35:50 +13:00
commit 0b79caf658
No known key found for this signature in database
GPG key ID: D300116E1C875A3D

View file

@ -58,7 +58,7 @@ void WalletInit::AddWalletOptions() const
gArgs.AddArg("-upgradewallet", "Upgrade wallet to latest format on startup", ArgsManager::ALLOW_ANY, OptionsCategory::WALLET);
gArgs.AddArg("-wallet=<path>", "Specify wallet database path. Can be specified multiple times to load multiple wallets. Path is interpreted relative to <walletdir> if it is not absolute, and will be created if it does not exist (as a directory containing a wallet.dat file and log files). For backwards compatibility this will also accept names of existing data files in <walletdir>.)", ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::WALLET);
gArgs.AddArg("-walletbroadcast", strprintf("Make the wallet broadcast transactions (default: %u)", DEFAULT_WALLETBROADCAST), ArgsManager::ALLOW_ANY, OptionsCategory::WALLET);
gArgs.AddArg("-walletdir=<dir>", "Specify directory to hold wallets (default: <datadir>/wallets if it exists, otherwise <datadir>)", ArgsManager::ALLOW_ANY, OptionsCategory::WALLET);
gArgs.AddArg("-walletdir=<dir>", "Specify directory to hold wallets (default: <datadir>/wallets if it exists, otherwise <datadir>)", ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::WALLET);
#if HAVE_SYSTEM
gArgs.AddArg("-walletnotify=<cmd>", "Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)", ArgsManager::ALLOW_ANY, OptionsCategory::WALLET);
#endif