Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 1,216 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(CWalletTx &wtxIn) { | void CWallet::LoadToWallet(CWalletTx &wtxIn) { | ||||
// If wallet doesn't have a chain (e.g wallet-tool), lock can't be taken. | // If wallet doesn't have a chain (e.g wallet-tool), lock can't be taken. | ||||
auto locked_chain = LockChain(); | auto locked_chain = LockChain(); | ||||
// If tx hasn't been reorged out of chain while wallet being shutdown | // If tx hasn't been reorged out of chain while wallet being shutdown | ||||
▲ Show 20 Lines • Show All 4,221 Lines • Show Last 20 Lines |