Skip to content

Commit

Permalink
Fix proof-of-stake block signing.
Browse files Browse the repository at this point in the history
Add back mistakenly removed SignBlock() in proof-of-stake section of
BitcoinMiner().
  • Loading branch information
skwurp committed Apr 28, 2014
1 parent 7bd5a3a commit b943eee
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2759,8 +2759,6 @@ bool LoadExternalBlockFile(FILE* fileIn)
extern map<uint256, CAlert> mapAlerts;
extern CCriticalSection cs_mapAlerts;

static string strMintWarning;

string GetWarnings(string strFor)
{
int nPriority = 0;
Expand All @@ -2770,13 +2768,6 @@ string GetWarnings(string strFor)
if (GetBoolArg("-testsafemode"))
strRPC = "test";

// ppcoin: wallet lock warning for minting
if (strMintWarning != "")
{
nPriority = 0;
strStatusBar = strMintWarning;
}

// Misc warnings like out of disk space and clock is wrong
if (strMiscWarning != "")
{
Expand Down Expand Up @@ -4338,6 +4329,8 @@ void BitcoinMiner(CWallet *pwallet, bool fProofOfStake)
// ppcoin: if proof-of-stake block found then process block
if (pblock->IsProofOfStake())
{
if (!pblock->SignBlock(*pwalletMain))
continue;
printf("CPUMiner : proof-of-stake block found %s\n", pblock->GetHash().ToString().c_str());
SetThreadPriority(THREAD_PRIORITY_NORMAL);
CheckWork(pblock.get(), *pwalletMain, reservekey);
Expand Down Expand Up @@ -4396,10 +4389,7 @@ void BitcoinMiner(CWallet *pwallet, bool fProofOfStake)
pblock->nNonce = nNonceFound;
assert(result == pblock->GetHash());
if (!pblock->SignBlock(*pwalletMain))
{
break;
}
strMintWarning = "";

SetThreadPriority(THREAD_PRIORITY_NORMAL);
CheckWork(pblock.get(), *pwalletMain, reservekey);
Expand Down

0 comments on commit b943eee

Please sign in to comment.