mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Add accountPublicVerify to NewcoinAddress.
This commit is contained in:
@@ -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
|
||||
//
|
||||
|
||||
@@ -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
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user