Skip to content

Commit 26e0017

Browse files
committed
windows shell fix
1 parent 8267184 commit 26e0017

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/wallet/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void WalletInit::AddWalletOptions() const
5959
gArgs.AddArg("-walletbroadcast", strprintf("Make the wallet broadcast transactions (default: %u)", DEFAULT_WALLETBROADCAST), ArgsManager::ALLOW_ANY, OptionsCategory::WALLET);
6060
gArgs.AddArg("-walletdir=<dir>", "Specify directory to hold wallets (default: <datadir>/wallets if it exists, otherwise <datadir>)", ArgsManager::ALLOW_ANY, OptionsCategory::WALLET);
6161
#if HAVE_SYSTEM
62-
gArgs.AddArg("-walletnotify=<cmd>", "Execute command when a wallet transaction changes (%s in cmd is replaced by TxID and %w is replaced by wallet name)", ArgsManager::ALLOW_ANY, OptionsCategory::WALLET);
62+
gArgs.AddArg("-walletnotify=<cmd>", "Execute command when a wallet transaction changes. %s in cmd is replaced by TxID and %w is replaced by wallet name. %w is not currently implmented on windows. On systems where %w is supported, it should NOT be quoted because this would break shell escaping used to invoke the command.", ArgsManager::ALLOW_ANY, OptionsCategory::WALLET);
6363
#endif
6464
gArgs.AddArg("-walletrbf", strprintf("Send transactions with full-RBF opt-in enabled (RPC only, default: %u)", DEFAULT_WALLET_RBF), ArgsManager::ALLOW_ANY, OptionsCategory::WALLET);
6565
gArgs.AddArg("-zapwallettxes=<mode>", "Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup"

src/wallet/wallet.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,9 +1156,12 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFlushOnClose)
11561156
if (!strCmd.empty())
11571157
{
11581158
boost::replace_all(strCmd, "%s", wtxIn.GetHash().GetHex());
1159-
#ifdef WIN32
1160-
boost::replace_all(strCmd, "%w", GetName());
1161-
#else
1159+
#ifndef WIN32
1160+
// Substituting the wallet name isn't currently supported on windows
1161+
// because windows shell escaping has not been implemented yet:
1162+
// https://github.com/bitcoin/bitcoin/pull/13339#issuecomment-537384875
1163+
// A few ways it could be implemented in the future are described in:
1164+
// https://github.com/bitcoin/bitcoin/pull/13339#issuecomment-461288094
11621165
boost::replace_all(strCmd, "%w", ShellEscape(GetName()));
11631166
#endif
11641167
std::thread t(runCommand, strCmd);

0 commit comments

Comments
 (0)