diff options
author | Andrew Chow <achow101-github@achow101.com> | 2022-01-18 20:31:08 -0500 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2022-03-17 11:00:45 -0400 |
commit | b799814bbd53736b79495072f3c9e05989a465e8 (patch) | |
tree | 0d1bb9ae46b8dd858ffbff2d053bca68aeb41f66 /src/wallet/interfaces.cpp | |
parent | 46022953ee2e8113167bafd1fd48a383a578b13c (diff) | |
download | bitcoin-b799814bbd53736b79495072f3c9e05989a465e8.tar.xz |
wallet: Store tx time in COutput
Diffstat (limited to 'src/wallet/interfaces.cpp')
-rw-r--r-- | src/wallet/interfaces.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/wallet/interfaces.cpp b/src/wallet/interfaces.cpp index 2bc8e48943..56ca2f0cdb 100644 --- a/src/wallet/interfaces.cpp +++ b/src/wallet/interfaces.cpp @@ -111,6 +111,17 @@ WalletTxOut MakeWalletTxOut(const CWallet& wallet, return result; } +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.time = output.time; + result.depth_in_main_chain = output.depth; + result.is_spent = wallet.IsSpent(output.tx->GetHash(), output.i); + return result; +} + class WalletImpl : public Wallet { public: @@ -420,7 +431,7 @@ public: auto& group = result[entry.first]; for (const auto& coin : entry.second) { group.emplace_back(COutPoint(coin.tx->GetHash(), coin.i), - MakeWalletTxOut(*m_wallet, *coin.tx, coin.i, coin.depth)); + MakeWalletTxOut(*m_wallet, coin)); } } return result; |