Skip to content

Commit 849c19a

Browse files
committed
scripted-diff: test: rename strCmd to command
-BEGIN VERIFY SCRIPT- sed -i 's/\bstrCmd\b/command/g' $(git grep -l strCmd) -END VERIFY SCRIPT-
1 parent 06e1fb0 commit 849c19a

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/validation.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,18 +1347,18 @@ static void AlertNotify(const std::string& strMessage)
13471347
{
13481348
uiInterface.NotifyAlertChanged();
13491349
#if HAVE_SYSTEM
1350-
std::string strCmd = gArgs.GetArg("-alertnotify", "");
1351-
if (strCmd.empty()) return;
1350+
std::string command = gArgs.GetArg("-alertnotify", "");
1351+
if (command.empty()) return;
13521352

13531353
// Alert text should be plain ascii coming from a trusted source, but to
13541354
// be safe we first strip anything not in safeChars, then add single quotes around
13551355
// the whole string before passing it to the shell:
13561356
std::string singleQuote("'");
13571357
std::string safeStatus = SanitizeString(strMessage);
13581358
safeStatus = singleQuote+safeStatus+singleQuote;
1359-
boost::replace_all(strCmd, "%s", safeStatus);
1359+
boost::replace_all(command, "%s", safeStatus);
13601360

1361-
std::thread t(runCommand, strCmd);
1361+
std::thread t(runCommand, command);
13621362
t.detach(); // thread runs free
13631363
#endif
13641364
}

src/wallet/wallet.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -939,28 +939,28 @@ CWalletTx* CWallet::AddToWallet(CTransactionRef tx, const CWalletTx::Confirmatio
939939

940940
#if HAVE_SYSTEM
941941
// notify an external script when a wallet transaction comes in or is updated
942-
std::string strCmd = gArgs.GetArg("-walletnotify", "");
942+
std::string command = gArgs.GetArg("-walletnotify", "");
943943

944-
if (!strCmd.empty())
944+
if (!command.empty())
945945
{
946-
boost::replace_all(strCmd, "%s", hash.GetHex());
946+
boost::replace_all(command, "%s", hash.GetHex());
947947
if (confirm.status == CWalletTx::Status::CONFIRMED)
948948
{
949-
boost::replace_all(strCmd, "%b", confirm.hashBlock.GetHex());
950-
boost::replace_all(strCmd, "%h", ToString(confirm.block_height));
949+
boost::replace_all(command, "%b", confirm.hashBlock.GetHex());
950+
boost::replace_all(command, "%h", ToString(confirm.block_height));
951951
} else {
952-
boost::replace_all(strCmd, "%b", "unconfirmed");
953-
boost::replace_all(strCmd, "%h", "-1");
952+
boost::replace_all(command, "%b", "unconfirmed");
953+
boost::replace_all(command, "%h", "-1");
954954
}
955955
#ifndef WIN32
956956
// Substituting the wallet name isn't currently supported on windows
957957
// because windows shell escaping has not been implemented yet:
958958
// https://github.com/bitcoin/bitcoin/pull/13339#issuecomment-537384875
959959
// A few ways it could be implemented in the future are described in:
960960
// https://github.com/bitcoin/bitcoin/pull/13339#issuecomment-461288094
961-
boost::replace_all(strCmd, "%w", ShellEscape(GetName()));
961+
boost::replace_all(command, "%w", ShellEscape(GetName()));
962962
#endif
963-
std::thread t(runCommand, strCmd);
963+
std::thread t(runCommand, command);
964964
t.detach(); // thread runs free
965965
}
966966
#endif

0 commit comments

Comments
 (0)