| 54 | } |
| 55 | |
| 56 | bool MessageSign( |
| 57 | const CKey& privkey, |
| 58 | const std::string& message, |
| 59 | std::string& signature) |
| 60 | { |
| 61 | std::vector<unsigned char> signature_bytes; |
| 62 | |
| 63 | if (!privkey.SignCompact(MessageHash(message), signature_bytes)) { |
| 64 | return false; |
| 65 | } |
| 66 | |
| 67 | signature = EncodeBase64(signature_bytes); |
| 68 | |
| 69 | return true; |
| 70 | } |
| 71 | |
| 72 | uint256 MessageHash(const std::string& message) |
| 73 | { |