diff options
author | Andrew Chow <achow101-github@achow101.com> | 2022-01-18 19:08:42 -0500 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2022-03-23 14:32:07 -0400 |
commit | 14d04d5ad15ae56df56edee7ca9a202b52037889 (patch) | |
tree | 086d701ed87f5b028256d3179e348f0228c468e0 /src/wallet/interfaces.cpp | |
parent | 0ba4d1916e26e2a5d603edcdb7625463989d25b6 (diff) |
wallet: Replace CWalletTx in COutput with COutPoint and CTxOut
Instead of having a pointer to the CWalletTx in COutput, we can just
store the COutPoint and the CTxOut as those are the only things we need
from the CWalletTx. Other things CWalletTx used to provide were time and
fIsFromMe but these are also being stored by COutput.
Diffstat (limited to 'src/wallet/interfaces.cpp')
-rw-r--r-- | src/wallet/interfaces.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wallet/interfaces.cpp b/src/wallet/interfaces.cpp index 56ca2f0cdb..087d1df2a9 100644 --- a/src/wallet/interfaces.cpp +++ b/src/wallet/interfaces.cpp @@ -115,10 +115,10 @@ WalletTxOut MakeWalletTxOut(const CWallet& wallet, const COutput& output) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) { WalletTxOut result; - result.txout = output.tx->tx->vout[output.i]; + result.txout = output.txout; result.time = output.time; result.depth_in_main_chain = output.depth; - result.is_spent = wallet.IsSpent(output.tx->GetHash(), output.i); + result.is_spent = wallet.IsSpent(output.outpoint.hash, output.outpoint.n); return result; } @@ -430,7 +430,7 @@ public: for (const auto& entry : ListCoins(*m_wallet)) { auto& group = result[entry.first]; for (const auto& coin : entry.second) { - group.emplace_back(COutPoint(coin.tx->GetHash(), coin.i), + group.emplace_back(coin.outpoint, MakeWalletTxOut(*m_wallet, coin)); } } |