| 126 | } |
| 127 | |
| 128 | bool CAlert::CheckSignature() const { |
| 129 | CPubKey key(SysCfg().AlertKey()); |
| 130 | if (!key.Verify(Hash(vchMsg.begin(), vchMsg.end()), vchSig)) |
| 131 | return ERRORMSG("CAlert::CheckSignature() : verify signature failed"); |
| 132 | |
| 133 | // Now unserialize the data |
| 134 | CDataStream sMsg(vchMsg, SER_NETWORK, PROTOCOL_VERSION); |
| 135 | sMsg >> *(CUnsignedAlert*)this; |
| 136 | return true; |
| 137 | } |
| 138 | |
| 139 | CAlert CAlert::getAlertByHash(const uint256 &hash) { |
| 140 | CAlert retval; |