@@ -1297,37 +1297,24 @@ CAmount CWalletTx::GetUnspentCredit(const isminefilter& filter) const
12971297 if (GetBlocksToMaturity () > 0 )
12981298 return 0 ;
12991299
1300- CAmount credit = 0 ;
1301- if (filter & ISMINE_SPENDABLE) {
1302- credit += GetCachableAmount (CREDIT, ISMINE_SPENDABLE, false , true );
1303- }
1304- if (filter & ISMINE_WATCH_ONLY) {
1305- credit += GetCachableAmount (CREDIT, ISMINE_WATCH_ONLY, false , true );
1306- }
1307- if (filter & ISMINE_COLD) {
1308- credit += GetCachableAmount (CREDIT, ISMINE_COLD, false , true );
1309- }
1310- if (filter & ISMINE_SPENDABLE_DELEGATED) {
1311- credit += GetCachableAmount (CREDIT, ISMINE_SPENDABLE_DELEGATED, false , true );
1312- }
1313- return credit;
1300+ return GetCredit (filter, false , true );
13141301}
13151302
1316- CAmount CWalletTx::GetCredit (const isminefilter& filter) const
1303+ CAmount CWalletTx::GetCredit (const isminefilter& filter, bool recalculate, bool fUnspent ) const
13171304{
13181305 CAmount credit = 0 ;
13191306 if (filter & ISMINE_SPENDABLE) {
13201307 // GetBalance can assume transactions in mapWallet won't change
1321- credit += GetCachableAmount (CREDIT, ISMINE_SPENDABLE);
1308+ credit += GetCachableAmount (CREDIT, ISMINE_SPENDABLE, recalculate, fUnspent );
13221309 }
13231310 if (filter & ISMINE_WATCH_ONLY) {
1324- credit += GetCachableAmount (CREDIT, ISMINE_WATCH_ONLY);
1311+ credit += GetCachableAmount (CREDIT, ISMINE_WATCH_ONLY, recalculate, fUnspent );
13251312 }
13261313 if (filter & ISMINE_COLD) {
1327- credit += GetCachableAmount (CREDIT, ISMINE_COLD);
1314+ credit += GetCachableAmount (CREDIT, ISMINE_COLD, recalculate, fUnspent );
13281315 }
13291316 if (filter & ISMINE_SPENDABLE_DELEGATED) {
1330- credit += GetCachableAmount (CREDIT, ISMINE_SPENDABLE_DELEGATED);
1317+ credit += GetCachableAmount (CREDIT, ISMINE_SPENDABLE_DELEGATED, recalculate, fUnspent );
13311318 }
13321319 return credit;
13331320}
0 commit comments