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

Method Sign

src/spork.cpp:167–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167bool CSporkManager::Sign(CSporkMessage& spork) {
168 std::string strMessage = boost::lexical_cast<std::string>(spork.nSporkID) + boost::lexical_cast<std::string>(spork.nValue) + boost::lexical_cast<std::string>(spork.nTimeSigned);
169
170 CKey key2;
171 CPubKey pubkey2;
172 std::string errorMessage = "";
173
174 if (!darkSendSigner.SetKey(strMasterPrivKey, errorMessage, key2, pubkey2)) {
175 LogPrintf("CMasternodePayments::Sign - ERROR: Invalid masternodeprivkey: '%s'\n", errorMessage.c_str());
176 return false;
177 }
178
179 if (!darkSendSigner.SignMessage(strMessage, errorMessage, spork.vchSig, key2)) {
180 LogPrintf("CMasternodePayments::Sign - Sign message failed");
181 return false;
182 }
183
184 if (!darkSendSigner.VerifyMessage(pubkey2, spork.vchSig, strMessage, errorMessage)) {
185 LogPrintf("CMasternodePayments::Sign - Verify message failed");
186 return false;
187 }
188
189 return true;
190}
191
192bool CSporkManager::UpdateSpork(int nSporkID, int64_t nValue) {
193

Callers

nothing calls this directly

Calls 3

SetKeyMethod · 0.45
SignMessageMethod · 0.45
VerifyMessageMethod · 0.45

Tested by

no test coverage detected