diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index c430877bfa44d..7be6cbd555eb1 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3332,6 +3332,7 @@ bool CWallet::CreateCoinStake( // Kernel Search CAmount nCredit; + CAmount nMasternodePayment; CScript scriptPubKeyKernel; bool fKernelFound = false; int nAttempts = 0; @@ -3374,10 +3375,11 @@ bool CWallet::CreateCoinStake( // Add block reward to the credit nCredit += GetBlockValue(pindexPrev->nHeight + 1); + nMasternodePayment = GetMasternodePayment(pindexPrev->nHeight + 1); // Create the output transaction(s) std::vector vout; - if (!CreateCoinstakeOuts(stakeInput, vout, nCredit)) { + if (!CreateCoinstakeOuts(stakeInput, vout, nCredit - nMasternodePayment)) { LogPrintf("%s : failed to create output\n", __func__); it++; continue;