MCPcopy Create free account
hub / github.com/LUX-Core/lux / Sign

Method Sign

src/masternode.cpp:705–728  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

703}
704
705bool CMasternodePayments::Sign(CMasternodePaymentWinner& winner) {
706 std::string strMessage = winner.vin.ToString().c_str() + boost::lexical_cast<std::string>(winner.nBlockHeight) + winner.payee.ToString();
707
708 CKey key2;
709 CPubKey pubkey2;
710 std::string errorMessage = "";
711
712 if (!darkSendSigner.SetKey(strMasterPrivKey, errorMessage, key2, pubkey2)) {
713 LogPrintf("CMasternodePayments::Sign - ERROR: Invalid masternodeprivkey: '%s'\n", errorMessage.c_str());
714 return false;
715 }
716
717 if (!darkSendSigner.SignMessage(strMessage, errorMessage, winner.vchSig, key2)) {
718 LogPrintf("CMasternodePayments::Sign - Sign message failed");
719 return false;
720 }
721
722 if (!darkSendSigner.VerifyMessage(pubkey2, winner.vchSig, strMessage, errorMessage)) {
723 LogPrintf("CMasternodePayments::Sign - Verify message failed");
724 return false;
725 }
726
727 return true;
728}
729
730uint64_t CMasternodePayments::CalculateScore(uint256 blockHash, CTxIn& vin) {
731 uint256 n1 = blockHash;

Callers

nothing calls this directly

Calls 4

ToStringMethod · 0.45
SetKeyMethod · 0.45
SignMessageMethod · 0.45
VerifyMessageMethod · 0.45

Tested by

no test coverage detected