From: CryptoManiac Date: Sat, 5 Mar 2016 21:34:26 +0000 (+0300) Subject: Add hex representation X-Git-Tag: nvc-v0.5.6~30 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=90d203d2e37a06a368a5ebc3af03c1d3af7ec04e Add hex representation --- diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 872471c..12b6603 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1905,8 +1905,13 @@ Value newmalleablekey(const Array& params, bool fHelp) if (!pwalletMain->GetMalleableKey(keyView, mKey)) throw runtime_error("Unable to generate new malleable key"); + CMalleablePubKey mPubKey = mKey.GetMalleablePubKey(); + CDataStream ssPublicBytes(SER_NETWORK, PROTOCOL_VERSION); + ssPublicBytes << mPubKey; + Object result; - result.push_back(Pair("PublicPair", mKey.GetMalleablePubKey().ToString())); + result.push_back(Pair("PublicPair", mPubKey.ToString())); + result.push_back(Pair("PublicBytes", HexStr(ssPublicBytes.begin(), ssPublicBytes.end()))); result.push_back(Pair("KeyView", keyView.ToString())); return result; @@ -1976,7 +1981,7 @@ Value adjustmalleablepubkey(const Array& params, bool fHelp) string pubKeyPair = params[0].get_str(); CMalleablePubKey malleablePubKey; - if (pubKeyPair.size() == 138) { + if (pubKeyPair.size() == 136) { CDataStream ssPublicBytes(ParseHex(pubKeyPair), SER_NETWORK, PROTOCOL_VERSION); ssPublicBytes >> malleablePubKey; } else