CKey privKeyVariant;
CPubKey vchPubKeyVariant = CPubKey(ParseHex(params[1].get_str()));
- CPubKey vchR = CPubKey(ParseHex(params[2].get_str()));
- if (!malleableKey.CheckKeyVariant(vchR,vchPubKeyVariant, privKeyVariant)) {
+ CPubKey R(ParseHex(params[2].get_str()));
+
+ if (!malleableKey.CheckKeyVariant(R,vchPubKeyVariant, privKeyVariant)) {
throw runtime_error("Unable to calculate the private key");
}
result.push_back(Pair("PubkeyVariant", HexStr(vchPubKeyVariant.Raw())));
result.push_back(Pair("KeyVariantID", CBitcoinAddress(vchPubKeyVariant.GetID()).ToString()));
+
+ return result;
+}
+
+Value listmalleablepubkeys(const Array& params, bool fHelp)
+{
+ if (fHelp || params.size() != 0)
+ throw runtime_error(
+ "listmalleablepubkeys\n"
+ "Get list of malleable public keys.\n");
+
+ std::list<CMalleablePubKey> keyList;
+ pwalletMain->ListMalleablePubKeys(keyList);
+
+ Array result;
+ BOOST_FOREACH(const CMalleablePubKey &key, keyList)
+ {
+ result.push_back(key.ToString());
+ }
+
return result;
}