Fix coverity CID 102345
[novacoin.git] / src / base58.cpp
index 2691ea4..29591b3 100644 (file)
@@ -130,7 +130,7 @@ 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());
+    auto hash = Hash(vch.begin(), vch.end());
     vch.insert(vch.end(), (unsigned char*)&hash, (unsigned char*)&hash + 4);
     return EncodeBase58(vch);
 }
@@ -146,7 +146,7 @@ bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet)
         vchRet.clear();
         return false;
     }
-    uint256 hash = Hash(vchRet.begin(), vchRet.end()-4);
+    auto hash = Hash(vchRet.begin(), vchRet.end()-4);
     if (memcmp(&hash, &vchRet.end()[-4], 4) != 0)
     {
         vchRet.clear();
@@ -254,6 +254,13 @@ bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRe
         return true;
     }
 
+    bool CBitcoinAddress::Set(const CBitcoinAddress &dest)
+    {
+        nVersion = dest.nVersion;
+        vchData = dest.vchData;
+        return true;
+    }
+
     bool CBitcoinAddress::IsValid() const
     {
         unsigned int nExpectedSize = 20;