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

Method Sign

src/darksend.cpp:2043–2068  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2041}
2042
2043bool CDarksendQueue::Sign() {
2044 if (!fMasterNode) return false;
2045
2046 std::string strMessage = vin.ToString() + boost::lexical_cast<std::string>(nDenom) + boost::lexical_cast<std::string>(time) + boost::lexical_cast<std::string>(ready);
2047
2048 CKey key2;
2049 CPubKey pubkey2;
2050 std::string errorMessage = "";
2051
2052 if (!darkSendSigner.SetKey(strMasterNodePrivKey, errorMessage, key2, pubkey2)) {
2053 LogPrintf("CDarksendQueue():Relay - ERROR: Invalid masternodeprivkey: '%s'\n", errorMessage.c_str());
2054 return false;
2055 }
2056
2057 if (!darkSendSigner.SignMessage(strMessage, errorMessage, vchSig, key2)) {
2058 LogPrintf("CDarksendQueue():Relay - Sign message failed");
2059 return false;
2060 }
2061
2062 if (!darkSendSigner.VerifyMessage(pubkey2, vchSig, strMessage, errorMessage)) {
2063 LogPrintf("CDarksendQueue():Relay - Verify message failed");
2064 return false;
2065 }
2066
2067 return true;
2068}
2069
2070bool CDarksendQueue::Relay() {
2071

Callers 2

CheckTimeoutMethod · 0.45

Calls 4

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

Tested by

no test coverage detected