Identify which hashes we're using.

This commit is contained in:
JoelKatz
2011-12-05 13:21:52 -08:00
parent c220e6bcfc
commit f7d1539df4
3 changed files with 7 additions and 7 deletions

View File

@@ -128,7 +128,7 @@ inline std::string EncodeBase58Check(const std::vector<unsigned char>& vchIn)
{
// add 4-byte hash check to the end
std::vector<unsigned char> vch(vchIn);
uint256 hash = Hash(vch.begin(), vch.end());
uint256 hash = SHA256Hash(vch.begin(), vch.end());
vch.insert(vch.end(), (unsigned char*)&hash, (unsigned char*)&hash + 4);
return EncodeBase58(vch);
}
@@ -142,7 +142,7 @@ inline bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRe
vchRet.clear();
return false;
}
uint256 hash = Hash(vchRet.begin(), vchRet.end()-4);
uint256 hash = SHA256Hash(vchRet.begin(), vchRet.end()-4);
if (memcmp(&hash, &vchRet.end()[-4], 4) != 0)
{
vchRet.clear();