mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 12:22:39 -03:00
wallet: set '-walletnotify' script instead of access global args manager
This commit is contained in:
parent
3477a28dd3
commit
d8f5fc4462
2 changed files with 5 additions and 1 deletions
|
@ -1108,7 +1108,7 @@ CWalletTx* CWallet::AddToWallet(CTransactionRef tx, const TxState& state, const
|
|||
|
||||
#if HAVE_SYSTEM
|
||||
// notify an external script when a wallet transaction comes in or is updated
|
||||
std::string strCmd = m_args.GetArg("-walletnotify", "");
|
||||
std::string strCmd = m_notify_tx_changed_script;
|
||||
|
||||
if (!strCmd.empty())
|
||||
{
|
||||
|
@ -2915,6 +2915,7 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
|
|||
// should be possible to use std::allocate_shared.
|
||||
std::shared_ptr<CWallet> walletInstance(new CWallet(chain, name, args, std::move(database)), ReleaseWallet);
|
||||
walletInstance->m_keypool_size = std::max(args.GetIntArg("-keypool", DEFAULT_KEYPOOL_SIZE), int64_t{1});
|
||||
walletInstance->m_notify_tx_changed_script = args.GetArg("-walletnotify", "");
|
||||
|
||||
// Load wallet
|
||||
bool rescan_required = false;
|
||||
|
|
|
@ -645,6 +645,9 @@ public:
|
|||
/** Number of pre-generated keys/scripts by each spkm (part of the look-ahead process, used to detect payments) */
|
||||
int64_t m_keypool_size{DEFAULT_KEYPOOL_SIZE};
|
||||
|
||||
/** Notify external script when a wallet transaction comes in or is updated (handled by -walletnotify) */
|
||||
std::string m_notify_tx_changed_script;
|
||||
|
||||
size_t KeypoolCountExternalKeys() const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
||||
bool TopUpKeyPool(unsigned int kpSize = 0);
|
||||
|
||||
|
|
Loading…
Reference in a new issue