Skip to content

Commit 17394e2

Browse files
presstabFuzzbawls
authored andcommitted
Include both pending and mature zerocoins for automint calculations.
1 parent 30b921f commit 17394e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wallet.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3449,7 +3449,7 @@ void CWallet::AutoZeromint()
34493449
return;
34503450
}
34513451

3452-
CAmount nZerocoinBalance = GetPendingZerocoinBalance();
3452+
CAmount nZerocoinBalance = GetZerocoinBalance(false); //false includes both pending and mature zerocoins. Need total balance for this so nothing is overminted.
34533453
CAmount nBalance = GetUnlockedCoins(); // We only consider unlocked coins, this also excludes masternode-vins
34543454
// from being accidentally minted
34553455
CAmount nMintAmount = 0;
@@ -3521,7 +3521,7 @@ void CWallet::AutoZeromint()
35213521
LogPrintf("CWallet::AutoZeromint(): auto minting failed with error: %s\n", strError);
35223522
return;
35233523
}
3524-
nZerocoinBalance = GetPendingZerocoinBalance();
3524+
nZerocoinBalance = GetZerocoinBalance(false);
35253525
nBalance = GetUnlockedCoins();
35263526
dPercentage = 100 * (double)nZerocoinBalance / (double)(nZerocoinBalance + nBalance);
35273527
LogPrintf("CWallet::AutoZeromint() @ block %ld: successfully minted %ld zPIV. Current percentage of zPIV: %lf%%\n",

0 commit comments

Comments
 (0)