2017-08-02 07:19:28 -04:00
// Copyright (c) 2009-2010 Satoshi Nakamoto
2019-05-06 14:05:28 -04:00
// Copyright (c) 2009-2019 The Bitcoin Core developers
2017-08-02 07:19:28 -04:00
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
2018-03-30 05:48:29 -03:00
# include <init.h>
2017-09-28 15:13:29 -03:00
# include <interfaces/chain.h>
2017-11-09 21:57:53 -03:00
# include <net.h>
2019-09-17 19:28:03 -03:00
# include <node/context.h>
2018-07-09 04:15:50 -04:00
# include <outputtype.h>
2018-10-22 19:51:11 -03:00
# include <util/moneystr.h>
2019-06-17 03:56:52 -04:00
# include <util/system.h>
# include <util/translation.h>
2017-10-08 17:48:07 -03:00
# include <wallet/wallet.h>
2019-06-17 03:56:52 -04:00
# include <walletinitinterface.h>
2017-08-02 07:48:52 -04:00
2018-03-29 06:08:38 -03:00
class WalletInit : public WalletInitInterface {
public :
2018-09-07 13:36:53 -03:00
//! Was the wallet component compiled in.
bool HasWalletSupport ( ) const override { return true ; }
2018-03-29 06:08:38 -03:00
//! Return the wallets help message.
2018-04-28 17:54:58 -03:00
void AddWalletOptions ( ) const override ;
2018-03-29 06:08:38 -03:00
//! Wallets parameter interaction
2018-04-13 10:02:59 -03:00
bool ParameterInteraction ( ) const override ;
2018-03-29 06:08:38 -03:00
2019-09-17 18:04:39 -03:00
//! Add wallets that should be opened to list of chain clients.
void Construct ( NodeContext & node ) const override ;
2018-03-29 06:08:38 -03:00
} ;
2018-04-13 10:05:55 -03:00
const WalletInitInterface & g_wallet_init_interface = WalletInit ( ) ;
2018-03-29 06:08:38 -03:00
2018-04-28 17:54:58 -03:00
void WalletInit : : AddWalletOptions ( ) const
2017-08-02 07:48:52 -04:00
{
scripted-diff: Use ArgsManager::DEBUG_ONLY flag
-BEGIN VERIFY SCRIPT-
sed -i 's/unsigned int flags, const bool debug_only,/unsigned int flags,/' src/util/system.h src/util/system.cpp
sed -i 's/ArgsManager::NONE, debug_only/flags, false/' src/util/system.cpp
sed -i 's/arg.second.m_debug_only/(arg.second.m_flags \& ArgsManager::DEBUG_ONLY)/' src/util/system.cpp
sed -i 's/ArgsManager::ALLOW_ANY, true, OptionsCategory::/ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
sed -i 's/ArgsManager::ALLOW_ANY, false, OptionsCategory::/ArgsManager::ALLOW_ANY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
-END VERIFY SCRIPT-
2019-07-27 05:06:32 -04:00
gArgs . AddArg ( " -addresstype " , strprintf ( " What type of addresses to use ( \" legacy \" , \" p2sh-segwit \" , or \" bech32 \" , default: \" %s \" ) " , FormatOutputType ( DEFAULT_ADDRESS_TYPE ) ) , ArgsManager : : ALLOW_ANY , OptionsCategory : : WALLET ) ;
gArgs . AddArg ( " -avoidpartialspends " , strprintf ( " Group outputs by address, selecting all or none, instead of selecting on a per-output basis. Privacy is improved as an address is only used once (unless someone sends to it after spending from it), but may result in slightly higher fees as suboptimal coin selection may result due to the added limitation (default: %u (always enabled for wallets with \" avoid_reuse \" enabled)) " , DEFAULT_AVOIDPARTIALSPENDS ) , ArgsManager : : ALLOW_ANY , OptionsCategory : : WALLET ) ;
gArgs . AddArg ( " -changetype " , " What type of change to use ( \" legacy \" , \" p2sh-segwit \" , or \" bech32 \" ). Default is same as -addresstype, except when -addresstype=p2sh-segwit a native segwit output is used when sending to a native segwit address) " , ArgsManager : : ALLOW_ANY , OptionsCategory : : WALLET ) ;
gArgs . AddArg ( " -disablewallet " , " Do not load the wallet and disable wallet RPC calls " , ArgsManager : : ALLOW_ANY , OptionsCategory : : WALLET ) ;
2018-05-29 12:49:44 -04:00
gArgs . AddArg ( " -discardfee=<amt> " , strprintf ( " The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). "
" Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target " ,
scripted-diff: Use ArgsManager::DEBUG_ONLY flag
-BEGIN VERIFY SCRIPT-
sed -i 's/unsigned int flags, const bool debug_only,/unsigned int flags,/' src/util/system.h src/util/system.cpp
sed -i 's/ArgsManager::NONE, debug_only/flags, false/' src/util/system.cpp
sed -i 's/arg.second.m_debug_only/(arg.second.m_flags \& ArgsManager::DEBUG_ONLY)/' src/util/system.cpp
sed -i 's/ArgsManager::ALLOW_ANY, true, OptionsCategory::/ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
sed -i 's/ArgsManager::ALLOW_ANY, false, OptionsCategory::/ArgsManager::ALLOW_ANY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
-END VERIFY SCRIPT-
2019-07-27 05:06:32 -04:00
CURRENCY_UNIT , FormatMoney ( DEFAULT_DISCARD_FEE ) ) , ArgsManager : : ALLOW_ANY , OptionsCategory : : WALLET ) ;
2019-08-01 16:39:46 -04:00
gArgs . AddArg ( " -fallbackfee=<amt> " , strprintf ( " A fee rate (in %s/kB) that will be used when fee estimation has insufficient data. 0 to entirely disable the fallbackfee feature. (default: %s) " ,
scripted-diff: Use ArgsManager::DEBUG_ONLY flag
-BEGIN VERIFY SCRIPT-
sed -i 's/unsigned int flags, const bool debug_only,/unsigned int flags,/' src/util/system.h src/util/system.cpp
sed -i 's/ArgsManager::NONE, debug_only/flags, false/' src/util/system.cpp
sed -i 's/arg.second.m_debug_only/(arg.second.m_flags \& ArgsManager::DEBUG_ONLY)/' src/util/system.cpp
sed -i 's/ArgsManager::ALLOW_ANY, true, OptionsCategory::/ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
sed -i 's/ArgsManager::ALLOW_ANY, false, OptionsCategory::/ArgsManager::ALLOW_ANY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
-END VERIFY SCRIPT-
2019-07-27 05:06:32 -04:00
CURRENCY_UNIT , FormatMoney ( DEFAULT_FALLBACK_FEE ) ) , ArgsManager : : ALLOW_ANY , OptionsCategory : : WALLET ) ;
gArgs . AddArg ( " -keypool=<n> " , strprintf ( " Set key pool size to <n> (default: %u) " , DEFAULT_KEYPOOL_SIZE ) , ArgsManager : : ALLOW_ANY , OptionsCategory : : WALLET ) ;
2019-02-20 15:45:16 -03:00
gArgs . AddArg ( " -maxtxfee=<amt> " , strprintf ( " Maximum total fees (in %s) to use in a single wallet transaction; setting this too low may abort large transactions (default: %s) " ,
scripted-diff: Use ArgsManager::DEBUG_ONLY flag
-BEGIN VERIFY SCRIPT-
sed -i 's/unsigned int flags, const bool debug_only,/unsigned int flags,/' src/util/system.h src/util/system.cpp
sed -i 's/ArgsManager::NONE, debug_only/flags, false/' src/util/system.cpp
sed -i 's/arg.second.m_debug_only/(arg.second.m_flags \& ArgsManager::DEBUG_ONLY)/' src/util/system.cpp
sed -i 's/ArgsManager::ALLOW_ANY, true, OptionsCategory::/ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
sed -i 's/ArgsManager::ALLOW_ANY, false, OptionsCategory::/ArgsManager::ALLOW_ANY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
-END VERIFY SCRIPT-
2019-07-27 05:06:32 -04:00
CURRENCY_UNIT , FormatMoney ( DEFAULT_TRANSACTION_MAXFEE ) ) , ArgsManager : : ALLOW_ANY , OptionsCategory : : DEBUG_TEST ) ;
2018-05-29 12:49:44 -04:00
gArgs . AddArg ( " -mintxfee=<amt> " , strprintf ( " Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s) " ,
scripted-diff: Use ArgsManager::DEBUG_ONLY flag
-BEGIN VERIFY SCRIPT-
sed -i 's/unsigned int flags, const bool debug_only,/unsigned int flags,/' src/util/system.h src/util/system.cpp
sed -i 's/ArgsManager::NONE, debug_only/flags, false/' src/util/system.cpp
sed -i 's/arg.second.m_debug_only/(arg.second.m_flags \& ArgsManager::DEBUG_ONLY)/' src/util/system.cpp
sed -i 's/ArgsManager::ALLOW_ANY, true, OptionsCategory::/ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
sed -i 's/ArgsManager::ALLOW_ANY, false, OptionsCategory::/ArgsManager::ALLOW_ANY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
-END VERIFY SCRIPT-
2019-07-27 05:06:32 -04:00
CURRENCY_UNIT , FormatMoney ( DEFAULT_TRANSACTION_MINFEE ) ) , ArgsManager : : ALLOW_ANY , OptionsCategory : : WALLET ) ;
2018-05-29 12:49:44 -04:00
gArgs . AddArg ( " -paytxfee=<amt> " , strprintf ( " Fee (in %s/kB) to add to transactions you send (default: %s) " ,
scripted-diff: Use ArgsManager::DEBUG_ONLY flag
-BEGIN VERIFY SCRIPT-
sed -i 's/unsigned int flags, const bool debug_only,/unsigned int flags,/' src/util/system.h src/util/system.cpp
sed -i 's/ArgsManager::NONE, debug_only/flags, false/' src/util/system.cpp
sed -i 's/arg.second.m_debug_only/(arg.second.m_flags \& ArgsManager::DEBUG_ONLY)/' src/util/system.cpp
sed -i 's/ArgsManager::ALLOW_ANY, true, OptionsCategory::/ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
sed -i 's/ArgsManager::ALLOW_ANY, false, OptionsCategory::/ArgsManager::ALLOW_ANY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
-END VERIFY SCRIPT-
2019-07-27 05:06:32 -04:00
CURRENCY_UNIT , FormatMoney ( CFeeRate { DEFAULT_PAY_TX_FEE } . GetFeePerK ( ) ) ) , ArgsManager : : ALLOW_ANY , OptionsCategory : : WALLET ) ;
gArgs . AddArg ( " -rescan " , " Rescan the block chain for missing wallet transactions on startup " , ArgsManager : : ALLOW_ANY , OptionsCategory : : WALLET ) ;
gArgs . AddArg ( " -salvagewallet " , " Attempt to recover private keys from a corrupt wallet on startup " , ArgsManager : : ALLOW_ANY , OptionsCategory : : WALLET ) ;
gArgs . AddArg ( " -spendzeroconfchange " , strprintf ( " Spend unconfirmed change when sending transactions (default: %u) " , DEFAULT_SPEND_ZEROCONF_CHANGE ) , ArgsManager : : ALLOW_ANY , OptionsCategory : : WALLET ) ;
gArgs . AddArg ( " -txconfirmtarget=<n> " , strprintf ( " If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u) " , DEFAULT_TX_CONFIRM_TARGET ) , ArgsManager : : ALLOW_ANY , OptionsCategory : : WALLET ) ;
gArgs . AddArg ( " -upgradewallet " , " Upgrade wallet to latest format on startup " , ArgsManager : : ALLOW_ANY , OptionsCategory : : WALLET ) ;
2019-07-27 05:37:09 -04:00
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 ) ;
scripted-diff: Use ArgsManager::DEBUG_ONLY flag
-BEGIN VERIFY SCRIPT-
sed -i 's/unsigned int flags, const bool debug_only,/unsigned int flags,/' src/util/system.h src/util/system.cpp
sed -i 's/ArgsManager::NONE, debug_only/flags, false/' src/util/system.cpp
sed -i 's/arg.second.m_debug_only/(arg.second.m_flags \& ArgsManager::DEBUG_ONLY)/' src/util/system.cpp
sed -i 's/ArgsManager::ALLOW_ANY, true, OptionsCategory::/ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
sed -i 's/ArgsManager::ALLOW_ANY, false, OptionsCategory::/ArgsManager::ALLOW_ANY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
-END VERIFY SCRIPT-
2019-07-27 05:06:32 -04:00
gArgs . AddArg ( " -walletbroadcast " , strprintf ( " Make the wallet broadcast transactions (default: %u) " , DEFAULT_WALLETBROADCAST ) , ArgsManager : : ALLOW_ANY , OptionsCategory : : WALLET ) ;
2019-11-11 21:16:17 -03:00
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 ) ;
2019-07-05 12:30:15 -04:00
# if HAVE_SYSTEM
scripted-diff: Use ArgsManager::DEBUG_ONLY flag
-BEGIN VERIFY SCRIPT-
sed -i 's/unsigned int flags, const bool debug_only,/unsigned int flags,/' src/util/system.h src/util/system.cpp
sed -i 's/ArgsManager::NONE, debug_only/flags, false/' src/util/system.cpp
sed -i 's/arg.second.m_debug_only/(arg.second.m_flags \& ArgsManager::DEBUG_ONLY)/' src/util/system.cpp
sed -i 's/ArgsManager::ALLOW_ANY, true, OptionsCategory::/ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
sed -i 's/ArgsManager::ALLOW_ANY, false, OptionsCategory::/ArgsManager::ALLOW_ANY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
-END VERIFY SCRIPT-
2019-07-27 05:06:32 -04:00
gArgs . AddArg ( " -walletnotify=<cmd> " , " Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) " , ArgsManager : : ALLOW_ANY , OptionsCategory : : WALLET ) ;
2019-03-14 07:30:37 -03:00
# endif
scripted-diff: Use ArgsManager::DEBUG_ONLY flag
-BEGIN VERIFY SCRIPT-
sed -i 's/unsigned int flags, const bool debug_only,/unsigned int flags,/' src/util/system.h src/util/system.cpp
sed -i 's/ArgsManager::NONE, debug_only/flags, false/' src/util/system.cpp
sed -i 's/arg.second.m_debug_only/(arg.second.m_flags \& ArgsManager::DEBUG_ONLY)/' src/util/system.cpp
sed -i 's/ArgsManager::ALLOW_ANY, true, OptionsCategory::/ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
sed -i 's/ArgsManager::ALLOW_ANY, false, OptionsCategory::/ArgsManager::ALLOW_ANY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
-END VERIFY SCRIPT-
2019-07-27 05:06:32 -04:00
gArgs . AddArg ( " -walletrbf " , strprintf ( " Send transactions with full-RBF opt-in enabled (RPC only, default: %u) " , DEFAULT_WALLET_RBF ) , ArgsManager : : ALLOW_ANY , OptionsCategory : : WALLET ) ;
2018-05-29 12:49:44 -04:00
gArgs . AddArg ( " -zapwallettxes=<mode> " , " Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup "
scripted-diff: Use ArgsManager::DEBUG_ONLY flag
-BEGIN VERIFY SCRIPT-
sed -i 's/unsigned int flags, const bool debug_only,/unsigned int flags,/' src/util/system.h src/util/system.cpp
sed -i 's/ArgsManager::NONE, debug_only/flags, false/' src/util/system.cpp
sed -i 's/arg.second.m_debug_only/(arg.second.m_flags \& ArgsManager::DEBUG_ONLY)/' src/util/system.cpp
sed -i 's/ArgsManager::ALLOW_ANY, true, OptionsCategory::/ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
sed -i 's/ArgsManager::ALLOW_ANY, false, OptionsCategory::/ArgsManager::ALLOW_ANY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
-END VERIFY SCRIPT-
2019-07-27 05:06:32 -04:00
" (1 = keep tx meta data e.g. payment request information, 2 = drop tx meta data) " , ArgsManager : : ALLOW_ANY , OptionsCategory : : WALLET ) ;
2018-04-28 17:54:58 -03:00
scripted-diff: Use ArgsManager::DEBUG_ONLY flag
-BEGIN VERIFY SCRIPT-
sed -i 's/unsigned int flags, const bool debug_only,/unsigned int flags,/' src/util/system.h src/util/system.cpp
sed -i 's/ArgsManager::NONE, debug_only/flags, false/' src/util/system.cpp
sed -i 's/arg.second.m_debug_only/(arg.second.m_flags \& ArgsManager::DEBUG_ONLY)/' src/util/system.cpp
sed -i 's/ArgsManager::ALLOW_ANY, true, OptionsCategory::/ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
sed -i 's/ArgsManager::ALLOW_ANY, false, OptionsCategory::/ArgsManager::ALLOW_ANY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src)
-END VERIFY SCRIPT-
2019-07-27 05:06:32 -04:00
gArgs . AddArg ( " -dblogsize=<n> " , strprintf ( " Flush wallet database activity from memory to disk log every <n> megabytes (default: %u) " , DEFAULT_WALLET_DBLOGSIZE ) , ArgsManager : : ALLOW_ANY | ArgsManager : : DEBUG_ONLY , OptionsCategory : : WALLET_DEBUG_TEST ) ;
gArgs . AddArg ( " -flushwallet " , strprintf ( " Run a thread to flush wallet periodically (default: %u) " , DEFAULT_FLUSHWALLET ) , ArgsManager : : ALLOW_ANY | ArgsManager : : DEBUG_ONLY , OptionsCategory : : WALLET_DEBUG_TEST ) ;
gArgs . AddArg ( " -privdb " , strprintf ( " Sets the DB_PRIVATE flag in the wallet db environment (default: %u) " , DEFAULT_WALLET_PRIVDB ) , ArgsManager : : ALLOW_ANY | ArgsManager : : DEBUG_ONLY , OptionsCategory : : WALLET_DEBUG_TEST ) ;
gArgs . AddArg ( " -walletrejectlongchains " , strprintf ( " Wallet will not create transactions that violate mempool chain limits (default: %u) " , DEFAULT_WALLET_REJECT_LONG_CHAINS ) , ArgsManager : : ALLOW_ANY | ArgsManager : : DEBUG_ONLY , OptionsCategory : : WALLET_DEBUG_TEST ) ;
2017-08-02 07:48:52 -04:00
}
2018-04-13 10:02:59 -03:00
bool WalletInit : : ParameterInteraction ( ) const
2017-08-02 07:48:52 -04:00
{
2017-11-01 21:39:23 -03:00
if ( gArgs . GetBoolArg ( " -disablewallet " , DEFAULT_DISABLE_WALLET ) ) {
for ( const std : : string & wallet : gArgs . GetArgs ( " -wallet " ) ) {
LogPrintf ( " %s: parameter interaction: -disablewallet -> ignoring -wallet=%s \n " , __func__ , wallet ) ;
}
2017-08-02 07:48:52 -04:00
return true ;
2017-11-01 21:39:23 -03:00
}
const bool is_multiwallet = gArgs . GetArgs ( " -wallet " ) . size ( ) > 1 ;
2017-08-02 07:48:52 -04:00
if ( gArgs . GetBoolArg ( " -blocksonly " , DEFAULT_BLOCKSONLY ) & & gArgs . SoftSetBoolArg ( " -walletbroadcast " , false ) ) {
LogPrintf ( " %s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0 \n " , __func__ ) ;
}
if ( gArgs . GetBoolArg ( " -salvagewallet " , false ) ) {
if ( is_multiwallet ) {
return InitError ( strprintf ( " %s is only allowed with a single wallet file " , " -salvagewallet " ) ) ;
}
// Rewrite just private keys: rescan to find transactions
if ( gArgs . SoftSetBoolArg ( " -rescan " , true ) ) {
LogPrintf ( " %s: parameter interaction: -salvagewallet=1 -> setting -rescan=1 \n " , __func__ ) ;
}
}
2018-04-19 12:07:54 -03:00
bool zapwallettxes = gArgs . GetBoolArg ( " -zapwallettxes " , false ) ;
2017-08-02 07:48:52 -04:00
// -zapwallettxes implies dropping the mempool on startup
2018-04-19 12:07:54 -03:00
if ( zapwallettxes & & gArgs . SoftSetBoolArg ( " -persistmempool " , false ) ) {
LogPrintf ( " %s: parameter interaction: -zapwallettxes enabled -> setting -persistmempool=0 \n " , __func__ ) ;
2017-08-02 07:48:52 -04:00
}
// -zapwallettxes implies a rescan
2018-04-19 12:07:54 -03:00
if ( zapwallettxes ) {
2017-08-02 07:48:52 -04:00
if ( is_multiwallet ) {
return InitError ( strprintf ( " %s is only allowed with a single wallet file " , " -zapwallettxes " ) ) ;
}
if ( gArgs . SoftSetBoolArg ( " -rescan " , true ) ) {
2018-04-19 12:07:54 -03:00
LogPrintf ( " %s: parameter interaction: -zapwallettxes enabled -> setting -rescan=1 \n " , __func__ ) ;
2017-08-02 07:48:52 -04:00
}
}
if ( is_multiwallet ) {
if ( gArgs . GetBoolArg ( " -upgradewallet " , false ) ) {
return InitError ( strprintf ( " %s is only allowed with a single wallet file " , " -upgradewallet " ) ) ;
}
}
if ( gArgs . GetBoolArg ( " -sysperms " , false ) )
return InitError ( " -sysperms is not allowed in combination with enabled wallet functionality " ) ;
return true ;
}
2019-09-17 18:04:39 -03:00
void WalletInit : : Construct ( NodeContext & node ) const
2017-08-02 07:48:52 -04:00
{
if ( gArgs . GetBoolArg ( " -disablewallet " , DEFAULT_DISABLE_WALLET ) ) {
LogPrintf ( " Wallet disabled! \n " ) ;
2017-09-28 15:13:29 -03:00
return ;
2017-08-02 07:48:52 -04:00
}
2017-09-28 15:13:29 -03:00
gArgs . SoftSetArg ( " -wallet " , " " ) ;
2019-09-17 18:04:39 -03:00
node . chain_clients . emplace_back ( interfaces : : MakeWalletClient ( * node . chain , gArgs . GetArgs ( " -wallet " ) ) ) ;
2017-09-28 15:13:29 -03:00
}