File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -2129,10 +2129,20 @@ CAmount CWallet::GetLockedCoins() const
21292129{
21302130 if (fLiteMode ) return 0 ;
21312131
2132- return loopTxsBalance ([](const uint256& id, const CWalletTx& pcoin, CAmount& nTotal) {
2133- if (pcoin.IsTrusted () && pcoin.GetDepthInMainChain () > 0 )
2134- nTotal += pcoin.GetLockedCredit ();
2135- });
2132+ LOCK (cs_wallet);
2133+ if (setLockedCoins.empty ()) return 0 ;
2134+
2135+ CAmount ret = 0 ;
2136+ for (const auto & coin : setLockedCoins) {
2137+ auto it = mapWallet.find (coin.hash );
2138+ if (it != mapWallet.end ()) {
2139+ const CWalletTx& pcoin = it->second ;
2140+ if (pcoin.IsTrusted () && pcoin.GetDepthInMainChain () > 0 ) {
2141+ ret += it->second .tx ->vout .at (coin.n ).nValue ;
2142+ }
2143+ }
2144+ }
2145+ return ret;
21362146}
21372147
21382148CAmount CWallet::GetUnconfirmedBalance (isminetype filter) const
You can’t perform that action at this time.
0 commit comments