Commit b0f72c5c authored by coin-server's avatar coin-server

Added logging

parent 0f929c97
......@@ -190,7 +190,6 @@ bool CSporkManager::CheckSignature(CSporkMessage& spork, bool fCheckSigner)
std::string strMessage = std::to_string(spork.nSporkID) + std::to_string(spork.nValue) + std::to_string(spork.nTimeSigned);
CPubKey pubkeynew(ParseHex(Params().SporkKey()));
std::string errorMessage = "";
bool fValidWithNewKey = obfuScationSigner.VerifyMessage(pubkeynew, spork.vchSig,strMessage, errorMessage);
if (fCheckSigner && !fValidWithNewKey)
......@@ -217,16 +216,25 @@ bool CSporkManager::Sign(CSporkMessage& spork)
LogPrintf("CMasternodePayments::Sign - ERROR: Invalid masternodeprivkey: '%s'\n", errorMessage);
return false;
}
else{
LogPrintf("CMasternodePayments::Sign - obfuScationSigner.SetKey: '%s'\n", strMasterPrivKey);
}
if (!obfuScationSigner.SignMessage(strMessage, errorMessage, spork.vchSig, key2)) {
LogPrintf("CMasternodePayments::Sign - Sign message failed");
return false;
}
else{
LogPrintf("CMasternodePayments::Sign - obfuScationSigner.SignMessage: '%s'\n", strMessage);
}
if (!obfuScationSigner.VerifyMessage(pubkey2, spork.vchSig, strMessage, errorMessage)) {
LogPrintf("CMasternodePayments::Sign - Verify message failed");
return false;
}
else{
LogPrintf("CMasternodePayments::VerifyMessage - obfuScationSigner.SignMessage: '%s'\n", strMessage);
}
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment