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

Method Sign

src/alert.cpp:148–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148bool CAlert::Sign()
149{
150 CDataStream sMsg(SER_NETWORK, CLIENT_VERSION);
151 sMsg << *(CUnsignedAlert*)this;
152 vchMsg = std::vector<unsigned char>(sMsg.begin(), sMsg.end());
153 CBitcoinSecret vchSecret;
154 if (!vchSecret.SetString(GetArg("-alertkey", "")))
155 {
156 printf("CAlert::SignAlert() : vchSecret.SetString failed\n");
157 return false;
158 }
159 CKey key = vchSecret.GetKey();
160 if (!key.SignECDSA(Hash(vchMsg.begin(), vchMsg.end()), vchSig))
161 {
162 printf("CAlert::SignAlert() : key.SignECDSA failed\n");
163 return false;
164 }
165
166 return true;
167}
168
169bool CAlert::CheckSignature(const std::vector<unsigned char>& alertKey) const
170{

Callers 1

ThreadSendAlertFunction · 0.45

Calls 8

GetArgFunction · 0.85
printfFunction · 0.85
SetStringMethod · 0.80
SignECDSAMethod · 0.80
HashFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
GetKeyMethod · 0.45

Tested by

no test coverage detected