| 167 | } |
| 168 | |
| 169 | bool CAlert::CheckSignature(const std::vector<unsigned char>& alertKey) const |
| 170 | { |
| 171 | CPubKey key(alertKey); |
| 172 | if (!key.VerifyECDSA(Hash(vchMsg.begin(), vchMsg.end()), vchSig)) |
| 173 | return error("CAlert::CheckSignature() : verify signature failed"); |
| 174 | |
| 175 | // Now unserialize the data |
| 176 | CDataStream sMsg(vchMsg, SER_NETWORK, PROTOCOL_VERSION); |
| 177 | sMsg >> *(CUnsignedAlert*)this; |
| 178 | return true; |
| 179 | } |
| 180 | |
| 181 | CAlert CAlert::getAlertByHash(const uint256& hash) |
| 182 | { |