@@ -2252,46 +2252,6 @@ CAmount CWallet::GetImmatureWatchOnlyBalance() const
2252
2252
return nTotal;
2253
2253
}
2254
2254
2255
- // Calculate total balance in a different way from GetBalance. The biggest
2256
- // difference is that GetBalance sums up all unspent TxOuts paying to the
2257
- // wallet, while this sums up both spent and unspent TxOuts paying to the
2258
- // wallet, and then subtracts the values of TxIns spending from the wallet. This
2259
- // also has fewer restrictions on which unconfirmed transactions are considered
2260
- // trusted.
2261
- CAmount CWallet::GetLegacyBalance (const isminefilter& filter, int minDepth) const
2262
- {
2263
- auto locked_chain = chain ().lock ();
2264
- LOCK (cs_wallet);
2265
-
2266
- CAmount balance = 0 ;
2267
- for (const auto & entry : mapWallet) {
2268
- const CWalletTx& wtx = entry.second ;
2269
- const int depth = wtx.GetDepthInMainChain (*locked_chain);
2270
- if (depth < 0 || !locked_chain->checkFinalTx (*wtx.tx ) || wtx.IsImmatureCoinBase (*locked_chain)) {
2271
- continue ;
2272
- }
2273
-
2274
- // Loop through tx outputs and add incoming payments. For outgoing txs,
2275
- // treat change outputs specially, as part of the amount debited.
2276
- CAmount debit = wtx.GetDebit (filter);
2277
- const bool outgoing = debit > 0 ;
2278
- for (const CTxOut& out : wtx.tx ->vout ) {
2279
- if (outgoing && IsChange (out)) {
2280
- debit -= out.nValue ;
2281
- } else if (IsMine (out) & filter && depth >= minDepth) {
2282
- balance += out.nValue ;
2283
- }
2284
- }
2285
-
2286
- // For outgoing txs, subtract amount debited.
2287
- if (outgoing) {
2288
- balance -= debit;
2289
- }
2290
- }
2291
-
2292
- return balance;
2293
- }
2294
-
2295
2255
CAmount CWallet::GetAvailableBalance (const CCoinControl* coinControl) const
2296
2256
{
2297
2257
auto locked_chain = chain ().lock ();
0 commit comments