mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
createblindedaddress now takes blinding pubkey
This commit is contained in:
parent
5d766c1388
commit
a57ef6ba0c
2 changed files with 9 additions and 8 deletions
|
|
@ -362,7 +362,7 @@ UniValue createblindedaddress(const UniValue& params, bool fHelp)
|
|||
"\nCreates a blinded address using the provided blinding key.\n"
|
||||
"\nArguments:\n"
|
||||
"1. \"address\" (string, required) The unblinded address to be blinded.\n"
|
||||
"2. \"key\" (string, required) The blinding private key.\n"
|
||||
"2. \"key\" (string, required) The blinding public key. This can be obtained for a given address using `validateaddress`.\n"
|
||||
"\nResult:\n"
|
||||
"\"blinded_address\" (string) The blinded address.\n"
|
||||
"\nExamples:\n"
|
||||
|
|
@ -386,14 +386,14 @@ UniValue createblindedaddress(const UniValue& params, bool fHelp)
|
|||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid hexadecimal for key");
|
||||
}
|
||||
std::vector<unsigned char> keydata = ParseHex(params[1].get_str());
|
||||
if (keydata.size() != 32) {
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid hexadecimal key length, must be 32 bytes long.");
|
||||
if (keydata.size() != 33) {
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid hexadecimal key length, must be length 66.");
|
||||
}
|
||||
|
||||
CKey key;
|
||||
key.Set(keydata.begin(), keydata.end(), true);
|
||||
CPubKey key;
|
||||
key.Set(keydata.begin(), keydata.end());
|
||||
|
||||
return address.AddBlindingKey(key.GetPubKey()).ToString();
|
||||
return address.AddBlindingKey(key).ToString();
|
||||
}
|
||||
|
||||
UniValue verifymessage(const UniValue& params, bool fHelp)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue