Skip to content

Commit

Permalink
Get rid of BindWallet
Browse files Browse the repository at this point in the history
CWalletTx initialization has been fixed so it's no longer necessary to change
which wallet a transaction is bound to.
  • Loading branch information
ryanofsky committed May 1, 2020
1 parent d002f9d commit 28b112e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
3 changes: 1 addition & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,6 @@ CWalletTx* CWallet::AddToWallet(CTransactionRef tx, const CWalletTx::Confirmatio
// Inserts only if not already there, returns tx inserted or tx found
auto ret = mapWallet.emplace(std::piecewise_construct, std::forward_as_tuple(hash), std::forward_as_tuple(this, tx));
CWalletTx& wtx = (*ret.first).second;
wtx.BindWallet(this);
bool fInsertedNew = ret.second;
bool fUpdated = update_wtx && update_wtx(wtx, fInsertedNew);
if (fInsertedNew) {
Expand Down Expand Up @@ -3018,7 +3017,7 @@ void CWallet::CommitTransaction(CTransactionRef tx, mapValue_t mapValue, std::ve
// Notify that old coins are spent
for (const CTxIn& txin : tx->vin) {
CWalletTx &coin = mapWallet.at(txin.prevout.hash);
coin.BindWallet(this);
coin.MarkDirty();
NotifyTransactionChanged(this, coin.GetHash(), CT_UPDATED);
}

Expand Down
6 changes: 0 additions & 6 deletions src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -463,12 +463,6 @@ class CWalletTx
m_is_cache_empty = true;
}

void BindWallet(CWallet *pwalletIn)
{
pwallet = pwalletIn;
MarkDirty();
}

//! filter decides which addresses will count towards the debit
CAmount GetDebit(const isminefilter& filter) const;
CAmount GetCredit(const isminefilter& filter) const;
Expand Down

0 comments on commit 28b112e

Please sign in to comment.