minor auxpow fixes

This commit is contained in:
nzsquirrell
2015-08-25 20:21:41 +12:00
parent 20812d7aa7
commit 8f9e2b5427
2 changed files with 12 additions and 5 deletions
+8 -1
View File
@@ -1551,7 +1551,14 @@ bool CBlockHeader::CheckProofOfWork(int nHeight) const
{
if (auxpow.get() != NULL)
{
return error("CheckProofOfWork() : AUX POW is not allowed at this block");
if((algo == ALGO_SHA256D) || (algo == ALGO_SCRYPT))
{
return error("CheckProofOfWork() : AUX POW is not allowed at this block");
}
else
{
return error("CheckProofOfWork() : AUX POW is not allowed for this algo");
}
}
// Check if proof of work marches claimed amount
+4 -4
View File
@@ -660,10 +660,10 @@ Value getworkaux(const Array& params, bool fHelp)
);
if (vNodes.empty())
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Unitus is not connected!");
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Myriadcoin is not connected!");
if (IsInitialBlockDownload())
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Unitus is downloading blocks...");
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Myriadcoin is downloading blocks...");
// We use height plus one because we're testing the next block
if ((chainActive.Tip()->nHeight+1) < GetAuxPowStartBlock()) {
@@ -826,10 +826,10 @@ Value getauxblock(const Array& params, bool fHelp)
"the aux proof of work and returns true if it was successful.");
if (vNodes.empty())
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Unitus is not connected!");
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Myriadcoin is not connected!");
if (IsInitialBlockDownload())
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Unitus is downloading blocks...");
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Myriadcoin is downloading blocks...");
// We use height plus one because we're testing the next block
if ((chainActive.Tip()->nHeight+1) < GetAuxPowStartBlock()) {