mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
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.
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user