Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 1,217 Lines • ▼ Show 20 Lines | bool CWallet::AddToWallet(const CWalletTx &wtxIn, bool fFlushOnClose) { | ||||
} | } | ||||
// Break debit/credit balance caches: | // Break debit/credit balance caches: | ||||
wtx.MarkDirty(); | wtx.MarkDirty(); | ||||
// Notify UI of new or updated transaction. | // Notify UI of new or updated transaction. | ||||
NotifyTransactionChanged(this, txid, fInsertedNew ? CT_NEW : CT_UPDATED); | NotifyTransactionChanged(this, txid, fInsertedNew ? CT_NEW : CT_UPDATED); | ||||
#if defined(HAVE_SYSTEM) | |||||
// Notify an external script when a wallet transaction comes in or is | // Notify an external script when a wallet transaction comes in or is | ||||
// updated. | // updated. | ||||
std::string strCmd = gArgs.GetArg("-walletnotify", ""); | std::string strCmd = gArgs.GetArg("-walletnotify", ""); | ||||
if (!strCmd.empty()) { | if (!strCmd.empty()) { | ||||
boost::replace_all(strCmd, "%s", wtxIn.GetId().GetHex()); | boost::replace_all(strCmd, "%s", wtxIn.GetId().GetHex()); | ||||
std::thread t(runCommand, strCmd); | std::thread t(runCommand, strCmd); | ||||
// Thread runs free. | // Thread runs free. | ||||
t.detach(); | t.detach(); | ||||
} | } | ||||
#endif | |||||
return true; | return true; | ||||
} | } | ||||
void CWallet::LoadToWallet(const CWalletTx &wtxIn) { | void CWallet::LoadToWallet(const CWalletTx &wtxIn) { | ||||
const TxId &txid = wtxIn.GetId(); | const TxId &txid = wtxIn.GetId(); | ||||
const auto &ins = mapWallet.emplace(txid, wtxIn); | const auto &ins = mapWallet.emplace(txid, wtxIn); | ||||
CWalletTx &wtx = ins.first->second; | CWalletTx &wtx = ins.first->second; | ||||
▲ Show 20 Lines • Show All 4,196 Lines • Show Last 20 Lines |