Add accountPublicVerify to NewcoinAddress.

This commit is contained in:
Arthur Britto
2012-05-15 13:02:01 -07:00
parent 5202326384
commit 063ba4e381
2 changed files with 21 additions and 0 deletions

View File

@@ -303,6 +303,25 @@ void NewcoinAddress::setAccountPublic(const NewcoinAddress& generator, int seq)
setAccountPublic(pubkey.GetPubKey());
}
bool NewcoinAddress::accountPublicVerify(const uint256& uHash, const std::vector<unsigned char>& vucSig) const
{
CKey ckPublic;
bool bVerified;
if (!ckPublic.SetPubKey(getAccountPublic()))
{
// Bad private key.
std::cerr << "accountPublicVerify: Bad private key." << std::endl;
bVerified = false;
}
else
{
bVerified = ckPublic.Verify(uHash, vucSig);
}
return bVerified;
}
//
// AccountPrivate
//

View File

@@ -76,6 +76,8 @@ public:
void setAccountPublic(const std::vector<unsigned char>& vPublic);
void setAccountPublic(const NewcoinAddress& generator, int seq);
bool accountPublicVerify(const uint256& uHash, const std::vector<unsigned char>& vucSig) const;
//
// Accounts Private
//