mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
Merge #10976: [MOVEONLY] Move some static functions out of wallet.h/cpp
f01103cMOVEONLY: Init functions wallet/wallet.cpp -> wallet/init.cpp (Russell Yanofsky)e7fe320MOVEONLY: Fee functions wallet/wallet.cpp -> wallet/fees.cpp (Russell Yanofsky)d97fe20Move some static functions out of wallet.h/cpp (Russell Yanofsky) Pull request description: This just moves some static wallet fee and init functions out of `wallet/wallet.cpp` and into new `wallet/fees.cpp` and `wallet/init.cpp` source files. There is one commit updating declarations and callers, followed by two MOVEONLY commits actually moving the function bodies. This change is desirable because wallet.h/cpp are monolithic and hard to navigate, so pulling things out and grouping together pieces of related functionality should improve the organization. Another motivation is the wallet process separation work in https://github.com/bitcoin/bitcoin/pull/10973, where (at least initially) parameter parsing and fee estimation are still done in the main process rather than the wallet process, and having functions that run in different processes scrambled up throughout wallet.cpp is unnecessarily confusing. Tree-SHA512: 6e6982ff82b2ab4e681c043907e2b1801ceb9513394730070f16c46ad338278a863f5b3759aa13db76a259b268b1c919c81f4e339f0796a3cfb990161e8c316d
This commit is contained in:
11
src/init.cpp
11
src/init.cpp
@@ -43,6 +43,7 @@
|
||||
#include "utilmoneystr.h"
|
||||
#include "validationinterface.h"
|
||||
#ifdef ENABLE_WALLET
|
||||
#include "wallet/init.h"
|
||||
#include "wallet/wallet.h"
|
||||
#endif
|
||||
#include "warnings.h"
|
||||
@@ -420,7 +421,7 @@ std::string HelpMessage(HelpMessageMode mode)
|
||||
strUsage += HelpMessageOpt("-maxuploadtarget=<n>", strprintf(_("Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)"), DEFAULT_MAX_UPLOAD_TARGET));
|
||||
|
||||
#ifdef ENABLE_WALLET
|
||||
strUsage += CWallet::GetWalletHelpString(showDebug);
|
||||
strUsage += GetWalletHelpString(showDebug);
|
||||
#endif
|
||||
|
||||
#if ENABLE_ZMQ
|
||||
@@ -1035,7 +1036,7 @@ bool AppInitParameterInteraction()
|
||||
if (!ParseMoney(gArgs.GetArg("-minrelaytxfee", ""), n)) {
|
||||
return InitError(AmountErrMsg("minrelaytxfee", gArgs.GetArg("-minrelaytxfee", "")));
|
||||
}
|
||||
// High fee check is done afterward in CWallet::ParameterInteraction()
|
||||
// High fee check is done afterward in WalletParameterInteraction()
|
||||
::minRelayTxFee = CFeeRate(n);
|
||||
} else if (incrementalRelayFee > ::minRelayTxFee) {
|
||||
// Allow only setting incrementalRelayFee to control both
|
||||
@@ -1068,7 +1069,7 @@ bool AppInitParameterInteraction()
|
||||
nBytesPerSigOp = gArgs.GetArg("-bytespersigop", nBytesPerSigOp);
|
||||
|
||||
#ifdef ENABLE_WALLET
|
||||
if (!CWallet::ParameterInteraction())
|
||||
if (!WalletParameterInteraction())
|
||||
return false;
|
||||
#endif
|
||||
|
||||
@@ -1245,7 +1246,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
|
||||
|
||||
// ********************************************************* Step 5: verify wallet database integrity
|
||||
#ifdef ENABLE_WALLET
|
||||
if (!CWallet::Verify())
|
||||
if (!WalletVerify())
|
||||
return false;
|
||||
#endif
|
||||
// ********************************************************* Step 6: network initialization
|
||||
@@ -1566,7 +1567,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
|
||||
|
||||
// ********************************************************* Step 8: load wallet
|
||||
#ifdef ENABLE_WALLET
|
||||
if (!CWallet::InitLoadWallet())
|
||||
if (!InitLoadWallet())
|
||||
return false;
|
||||
#else
|
||||
LogPrintf("No wallet support compiled in!\n");
|
||||
|
||||
Reference in New Issue
Block a user