// Complete first hashing iteration
uint256 hash1;
SHA256_Update(&ctx, (unsigned char*)&nTimeTx, 4);
- SHA256_Final((unsigned char*)&hash1, &ctx);
+ SHA256_Final(hash1.begin(), &ctx);
// Restore context
ctx = workerCtx;
// Finally, calculate kernel hash
- SHA256((unsigned char*)&hash1, sizeof(hashProofOfStake), (unsigned char*)&hashProofOfStake);
+ SHA256(hash1.begin(), sizeof(hashProofOfStake), (unsigned char*)&hashProofOfStake);
// Skip if hash doesn't satisfy the maximum target
if (hashProofOfStake[7] > nMaxTarget32)
// Complete first hashing iteration
uint256 hash1;
SHA256_Update(&ctx, (unsigned char*)&nTimeTx, 4);
- SHA256_Final((unsigned char*)&hash1, &ctx);
+ SHA256_Final(hash1.begin(), &ctx);
// Restore context
ctx = workerCtx;
// Finally, calculate kernel hash
uint256 hashProofOfStake;
- SHA256((unsigned char*)&hash1, sizeof(hashProofOfStake), (unsigned char*)&hashProofOfStake);
+ SHA256(hash1.begin(), hashProofOfStake.size(), hashProofOfStake.begin());
// Skip if hash doesn't satisfy the maximum target
if (hashProofOfStake > nMaxTarget)
bool CKey::Sign(uint256 hash, std::vector<unsigned char>& vchSig)
{
vchSig.clear();
- auto sig = ECDSA_do_sign((unsigned char*)&hash, sizeof(hash), pkey);
+ auto sig = ECDSA_do_sign(hash.begin(), hash.size(), pkey);
if (sig==NULL)
return false;
auto group = EC_KEY_get0_group(pkey);