mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-04 04:45:10 +02:00
Wrap boost::replace_all
This commit is contained in:
@@ -44,8 +44,6 @@
|
||||
#include <assert.h>
|
||||
#include <optional>
|
||||
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
|
||||
using interfaces::FoundBlock;
|
||||
|
||||
namespace wallet {
|
||||
@@ -1018,14 +1016,14 @@ CWalletTx* CWallet::AddToWallet(CTransactionRef tx, const TxState& state, const
|
||||
|
||||
if (!strCmd.empty())
|
||||
{
|
||||
boost::replace_all(strCmd, "%s", hash.GetHex());
|
||||
ReplaceAll(strCmd, "%s", hash.GetHex());
|
||||
if (auto* conf = wtx.state<TxStateConfirmed>())
|
||||
{
|
||||
boost::replace_all(strCmd, "%b", conf->confirmed_block_hash.GetHex());
|
||||
boost::replace_all(strCmd, "%h", ToString(conf->confirmed_block_height));
|
||||
ReplaceAll(strCmd, "%b", conf->confirmed_block_hash.GetHex());
|
||||
ReplaceAll(strCmd, "%h", ToString(conf->confirmed_block_height));
|
||||
} else {
|
||||
boost::replace_all(strCmd, "%b", "unconfirmed");
|
||||
boost::replace_all(strCmd, "%h", "-1");
|
||||
ReplaceAll(strCmd, "%b", "unconfirmed");
|
||||
ReplaceAll(strCmd, "%h", "-1");
|
||||
}
|
||||
#ifndef WIN32
|
||||
// Substituting the wallet name isn't currently supported on windows
|
||||
@@ -1033,7 +1031,7 @@ CWalletTx* CWallet::AddToWallet(CTransactionRef tx, const TxState& state, const
|
||||
// https://github.com/bitcoin/bitcoin/pull/13339#issuecomment-537384875
|
||||
// A few ways it could be implemented in the future are described in:
|
||||
// https://github.com/bitcoin/bitcoin/pull/13339#issuecomment-461288094
|
||||
boost::replace_all(strCmd, "%w", ShellEscape(GetName()));
|
||||
ReplaceAll(strCmd, "%w", ShellEscape(GetName()));
|
||||
#endif
|
||||
std::thread t(runCommand, strCmd);
|
||||
t.detach(); // thread runs free
|
||||
|
||||
Reference in New Issue
Block a user