Skip to content

Commit 28b112e

Browse files
committed
Get rid of BindWallet
CWalletTx initialization has been fixed so it's no longer necessary to change which wallet a transaction is bound to.
1 parent d002f9d commit 28b112e

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

src/wallet/wallet.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,6 @@ CWalletTx* CWallet::AddToWallet(CTransactionRef tx, const CWalletTx::Confirmatio
806806
// Inserts only if not already there, returns tx inserted or tx found
807807
auto ret = mapWallet.emplace(std::piecewise_construct, std::forward_as_tuple(hash), std::forward_as_tuple(this, tx));
808808
CWalletTx& wtx = (*ret.first).second;
809-
wtx.BindWallet(this);
810809
bool fInsertedNew = ret.second;
811810
bool fUpdated = update_wtx && update_wtx(wtx, fInsertedNew);
812811
if (fInsertedNew) {
@@ -3018,7 +3017,7 @@ void CWallet::CommitTransaction(CTransactionRef tx, mapValue_t mapValue, std::ve
30183017
// Notify that old coins are spent
30193018
for (const CTxIn& txin : tx->vin) {
30203019
CWalletTx &coin = mapWallet.at(txin.prevout.hash);
3021-
coin.BindWallet(this);
3020+
coin.MarkDirty();
30223021
NotifyTransactionChanged(this, coin.GetHash(), CT_UPDATED);
30233022
}
30243023

src/wallet/wallet.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -463,12 +463,6 @@ class CWalletTx
463463
m_is_cache_empty = true;
464464
}
465465

466-
void BindWallet(CWallet *pwalletIn)
467-
{
468-
pwallet = pwalletIn;
469-
MarkDirty();
470-
}
471-
472466
//! filter decides which addresses will count towards the debit
473467
CAmount GetDebit(const isminefilter& filter) const;
474468
CAmount GetCredit(const isminefilter& filter) const;

0 commit comments

Comments
 (0)