Merge bitcoin/bitcoin#26889: refactor: wallet, remove global 'ArgsManager' dependency

52f4d567d6 refactor: remove <util/system.h> include from wallet.h (furszy)
6c9b342c30 refactor: wallet, remove global 'ArgsManager' access (furszy)
d8f5fc4462 wallet: set '-walletnotify' script instead of access global args manager (furszy)
3477a28dd3 wallet: set keypool_size instead of access global args manager (furszy)

Pull request description:

  Structurally, the wallet class shouldn't access the global `ArgsManager` class, its internal behavior shouldn't be coupled to a global command line args parsing object.

  So this PR migrates the only two places where we depend on it: (1) the keypool size, and (2) the "-walletnotify" script. And cleans up the, now unneeded, wallet `ArgsManager` ref member.

  Extra note:
  In the process of removing the args ref member, discovered and fixed files that were invalidly depending on the wallet header including `util/system.h`.

ACKs for top commit:
  achow101:
    ACK 52f4d567d6
  TheCharlatan:
    Re-ACK 52f4d567d6
  hebasto:
    re-ACK 52f4d567d6

Tree-SHA512: 0cffd99b4dd4864bf618aa45aeaabbef2b6441d27b6dbb03489c4e013330877682ff17b418d07aa25fbe1040bdf2c67d7559bdeb84128c5437bf0e6247719016
This commit is contained in:
Andrew Chow
2023-02-17 12:38:41 -05:00
27 changed files with 146 additions and 122 deletions

View File

@@ -17,7 +17,6 @@
#include <sync.h>
#include <uint256.h>
#include <util/bip32.h>
#include <util/system.h>
#include <util/time.h>
#include <util/translation.h>
#include <wallet/rpc/util.h>
@@ -1478,7 +1477,7 @@ static UniValue ProcessDescriptorImport(CWallet& wallet, const UniValue& data, c
} else {
warnings.push_back("Range not given, using default keypool range");
range_start = 0;
range_end = gArgs.GetIntArg("-keypool", DEFAULT_KEYPOOL_SIZE);
range_end = wallet.m_keypool_size;
}
next_index = range_start;

View File

@@ -6,6 +6,7 @@
#include <common/url.h>
#include <rpc/util.h>
#include <util/system.h>
#include <util/translation.h>
#include <wallet/context.h>
#include <wallet/wallet.h>