mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-27 11:43:26 -03:00
Remove unused wallet pointer from NotifyTransactionChanged signal
This commit is contained in:
parent
8cdf91735f
commit
faf3640303
4 changed files with 8 additions and 9 deletions
|
@ -69,7 +69,7 @@ uint256 SendCoins(CWallet& wallet, SendCoinsDialog& sendCoinsDialog, const CTxDe
|
||||||
->findChild<QCheckBox*>("optInRBF")
|
->findChild<QCheckBox*>("optInRBF")
|
||||||
->setCheckState(rbf ? Qt::Checked : Qt::Unchecked);
|
->setCheckState(rbf ? Qt::Checked : Qt::Unchecked);
|
||||||
uint256 txid;
|
uint256 txid;
|
||||||
boost::signals2::scoped_connection c(wallet.NotifyTransactionChanged.connect([&txid](CWallet*, const uint256& hash, ChangeType status) {
|
boost::signals2::scoped_connection c(wallet.NotifyTransactionChanged.connect([&txid](const uint256& hash, ChangeType status) {
|
||||||
if (status == CT_NEW) txid = hash;
|
if (status == CT_NEW) txid = hash;
|
||||||
}));
|
}));
|
||||||
ConfirmSend();
|
ConfirmSend();
|
||||||
|
|
|
@ -481,7 +481,7 @@ public:
|
||||||
std::unique_ptr<Handler> handleTransactionChanged(TransactionChangedFn fn) override
|
std::unique_ptr<Handler> handleTransactionChanged(TransactionChangedFn fn) override
|
||||||
{
|
{
|
||||||
return MakeHandler(m_wallet->NotifyTransactionChanged.connect(
|
return MakeHandler(m_wallet->NotifyTransactionChanged.connect(
|
||||||
[fn](CWallet*, const uint256& txid, ChangeType status) { fn(txid, status); }));
|
[fn](const uint256& txid, ChangeType status) { fn(txid, status); }));
|
||||||
}
|
}
|
||||||
std::unique_ptr<Handler> handleWatchOnlyChanged(WatchOnlyChangedFn fn) override
|
std::unique_ptr<Handler> handleWatchOnlyChanged(WatchOnlyChangedFn fn) override
|
||||||
{
|
{
|
||||||
|
|
|
@ -801,7 +801,7 @@ bool CWallet::MarkReplaced(const uint256& originalHash, const uint256& newHash)
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
NotifyTransactionChanged(this, originalHash, CT_UPDATED);
|
NotifyTransactionChanged(originalHash, CT_UPDATED);
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
@ -930,7 +930,7 @@ CWalletTx* CWallet::AddToWallet(CTransactionRef tx, const CWalletTx::Confirmatio
|
||||||
wtx.MarkDirty();
|
wtx.MarkDirty();
|
||||||
|
|
||||||
// Notify UI of new or updated transaction
|
// Notify UI of new or updated transaction
|
||||||
NotifyTransactionChanged(this, hash, fInsertedNew ? CT_NEW : CT_UPDATED);
|
NotifyTransactionChanged(hash, fInsertedNew ? CT_NEW : CT_UPDATED);
|
||||||
|
|
||||||
#if HAVE_SYSTEM
|
#if HAVE_SYSTEM
|
||||||
// notify an external script when a wallet transaction comes in or is updated
|
// notify an external script when a wallet transaction comes in or is updated
|
||||||
|
@ -1104,7 +1104,7 @@ bool CWallet::AbandonTransaction(const uint256& hashTx)
|
||||||
wtx.setAbandoned();
|
wtx.setAbandoned();
|
||||||
wtx.MarkDirty();
|
wtx.MarkDirty();
|
||||||
batch.WriteTx(wtx);
|
batch.WriteTx(wtx);
|
||||||
NotifyTransactionChanged(this, wtx.GetHash(), CT_UPDATED);
|
NotifyTransactionChanged(wtx.GetHash(), CT_UPDATED);
|
||||||
// Iterate over all its outputs, and mark transactions in the wallet that spend them abandoned too
|
// Iterate over all its outputs, and mark transactions in the wallet that spend them abandoned too
|
||||||
TxSpends::const_iterator iter = mapTxSpends.lower_bound(COutPoint(now, 0));
|
TxSpends::const_iterator iter = mapTxSpends.lower_bound(COutPoint(now, 0));
|
||||||
while (iter != mapTxSpends.end() && iter->first.hash == now) {
|
while (iter != mapTxSpends.end() && iter->first.hash == now) {
|
||||||
|
@ -1944,7 +1944,7 @@ void CWallet::CommitTransaction(CTransactionRef tx, mapValue_t mapValue, std::ve
|
||||||
for (const CTxIn& txin : tx->vin) {
|
for (const CTxIn& txin : tx->vin) {
|
||||||
CWalletTx &coin = mapWallet.at(txin.prevout.hash);
|
CWalletTx &coin = mapWallet.at(txin.prevout.hash);
|
||||||
coin.MarkDirty();
|
coin.MarkDirty();
|
||||||
NotifyTransactionChanged(this, coin.GetHash(), CT_UPDATED);
|
NotifyTransactionChanged(coin.GetHash(), CT_UPDATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the inserted-CWalletTx from mapWallet so that the
|
// Get the inserted-CWalletTx from mapWallet so that the
|
||||||
|
@ -1999,7 +1999,7 @@ DBErrors CWallet::ZapSelectTx(std::vector<uint256>& vHashIn, std::vector<uint256
|
||||||
for (const auto& txin : it->second.tx->vin)
|
for (const auto& txin : it->second.tx->vin)
|
||||||
mapTxSpends.erase(txin.prevout);
|
mapTxSpends.erase(txin.prevout);
|
||||||
mapWallet.erase(it);
|
mapWallet.erase(it);
|
||||||
NotifyTransactionChanged(this, hash, CT_DELETED);
|
NotifyTransactionChanged(hash, CT_DELETED);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nZapSelectTxRet == DBErrors::NEED_REWRITE)
|
if (nZapSelectTxRet == DBErrors::NEED_REWRITE)
|
||||||
|
|
|
@ -735,8 +735,7 @@ public:
|
||||||
* Wallet transaction added, removed or updated.
|
* Wallet transaction added, removed or updated.
|
||||||
* @note called with lock cs_wallet held.
|
* @note called with lock cs_wallet held.
|
||||||
*/
|
*/
|
||||||
boost::signals2::signal<void (CWallet *wallet, const uint256 &hashTx,
|
boost::signals2::signal<void(const uint256& hashTx, ChangeType status)> NotifyTransactionChanged;
|
||||||
ChangeType status)> NotifyTransactionChanged;
|
|
||||||
|
|
||||||
/** Show progress e.g. for rescan */
|
/** Show progress e.g. for rescan */
|
||||||
boost::signals2::signal<void (const std::string &title, int nProgress)> ShowProgress;
|
boost::signals2::signal<void (const std::string &title, int nProgress)> ShowProgress;
|
||||||
|
|
Loading…
Add table
Reference in a new issue