Skip to content

Commit 5d147d5

Browse files
presstabFuzzbawls
authored andcommitted
Remove balance check from CreateCoinStake().
1 parent b4a8f9b commit 5d147d5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/wallet.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2909,6 +2909,7 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int
29092909
CAmount nCredit = 0;
29102910
CScript scriptPubKeyKernel;
29112911
int nAttempts = 0;
2912+
bool fKernelFound = false;
29122913
for (CStakeInput* stakeInput : listInputs) {
29132914
//make sure that enough time has elapsed between
29142915
CBlockIndex* pindex = stakeInput->GetIndexFrom();
@@ -2919,8 +2920,6 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int
29192920

29202921
// Read block header
29212922
CBlockHeader block = pindex->GetBlockHeader();
2922-
2923-
bool fKernelFound = false;
29242923
uint256 hashProofOfStake = 0;
29252924
nTxNewTime = GetAdjustedTime();
29262925

@@ -2991,7 +2990,7 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int
29912990
if (fKernelFound)
29922991
break; // if kernel is found stop searching
29932992
}
2994-
if (nCredit == 0 || nCredit > (nBalance > 0 ? nBalance - nReserveBalance : GetZerocoinBalance(false))) {
2993+
if (!fKernelFound) {
29952994
LogPrintf("*** attempted to stake %d coins\n", nAttempts);
29962995
return false;
29972996
}

0 commit comments

Comments
 (0)