mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02: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:
parent
0ba4d1916e
commit
14d04d5ad1
6 changed files with 30 additions and 22 deletions
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue