// The stake modifier used to hash for a stake kernel is chosen as the stake
// modifier about a selection interval later than the coin generating the kernel
-static bool GetKernelStakeModifier(uint256 hashBlockFrom, uint64_t& nStakeModifier, int& nStakeModifierHeight, int64_t& nStakeModifierTime, bool fPrintProofOfStake)
+static bool GetKernelStakeModifier(const uint256 &hashBlockFrom, uint64_t& nStakeModifier, int& nStakeModifierHeight, int64_t& nStakeModifierTime, bool fPrintProofOfStake)
{
nStakeModifier = 0;
if (!mapBlockIndex.count(hashBlockFrom))
return true;
}
-bool GetKernelStakeModifier(uint256 hashBlockFrom, uint64_t& nStakeModifier)
+bool GetKernelStakeModifier(const uint256 &hashBlockFrom, uint64_t& nStakeModifier)
{
int nStakeModifierHeight;
int64_t nStakeModifierTime;
// The stake modifier used to hash for a stake kernel is chosen as the stake
// modifier about a selection interval later than the coin generating the kernel
-bool GetKernelStakeModifier(uint256 hashBlockFrom, uint64_t& nStakeModifier);
+bool GetKernelStakeModifier(const uint256 &hashBlockFrom, uint64_t& nStakeModifier);
// Check whether stake kernel meets hash target
// Sets hashProofOfStake on success return
// The format is one header byte, followed by two times 32 bytes for the serialized r and s values.
// The header byte: 0x1B = first key with even y, 0x1C = first key with odd y,
// 0x1D = second key with even y, 0x1E = second key with odd y
-bool CKey::SignCompact(uint256 hash, std::vector<unsigned char>& vchSig)
+bool CKey::SignCompact(const uint256 &hash, std::vector<unsigned char>& vchSig)
{
bool fOk = false;
auto sig = ECDSA_do_sign(hash.begin(), hash.size(), pkey);
// This is only slightly more CPU intensive than just verifying it.
// If this function succeeds, the recovered public key is guaranteed to be valid
// (the signature is a valid signature of the given data for that key)
-bool CPubKey::SetCompactSignature(uint256 hash, const std::vector<unsigned char>& vchSig)
+bool CPubKey::SetCompactSignature(const uint256 &hash, const std::vector<unsigned char>& vchSig)
{
if (vchSig.size() != 65)
return false;
return ret;
}
-bool CPubKey::VerifyCompact(uint256 hash, const std::vector<unsigned char>& vchSig)
+bool CPubKey::VerifyCompact(const uint256 &hash, const std::vector<unsigned char>& vchSig)
{
CPubKey key;
if (!key.SetCompactSignature(hash, vchSig))
}
bool Verify(const uint256& hash, const std::vector<unsigned char>& vchSig) const;
- bool VerifyCompact(uint256 hash, const std::vector<unsigned char>& vchSig);
+ bool VerifyCompact(const uint256 &hash, const std::vector<unsigned char>& vchSig);
- bool SetCompactSignature(uint256 hash, const std::vector<unsigned char>& vchSig);
+ bool SetCompactSignature(const uint256 &hash, const std::vector<unsigned char>& vchSig);
// Reserialize to DER
static bool ReserealizeSignature(std::vector<unsigned char>& vchSig);
// The format is one header byte, followed by two times 32 bytes for the serialized r and s values.
// The header byte: 0x1B = first key with even y, 0x1C = first key with odd y,
// 0x1D = second key with even y, 0x1E = second key with odd y
- bool SignCompact(uint256 hash, std::vector<unsigned char>& vchSig);
+ bool SignCompact(const uint256 &hash, std::vector<unsigned char>& vchSig);
bool IsValid();