X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Frpcwallet.cpp;h=22beb606d513390a38a90e9f752d675c93733692;hb=a4bd78df61a14ec83f4a2f71edb0e18b434a8779;hp=ad200624a6e195fdd1ba2a26f914e8eac6e69143;hpb=696a6c8d4ae9dd95429d3683f8edaefc7b902558;p=novacoin.git diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index ad20062..22beb60 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1870,9 +1870,13 @@ Value newmalleablekey(const Array& params, bool fHelp) malleableKey.MakeNewKeys(); CMalleablePubKey malleablePubKey = malleableKey.GetMalleablePubKey(); + CDataStream ssPublicBytes(SER_NETWORK, PROTOCOL_VERSION); + ssPublicBytes << malleablePubKey; + Object result; result.push_back(Pair("PrivatePair", malleableKey.ToString())); result.push_back(Pair("PublicPair", malleablePubKey.ToString())); + result.push_back(Pair("PublicBytes", HexStr(ssPublicBytes.begin(), ssPublicBytes.end()))); return result; } @@ -1911,8 +1915,14 @@ Value adjustmalleablepubkey(const Array& params, bool fHelp) "adjustmalleablepubkey \n" "Calculate new public key using provided malleable public key data.\n"); + string pubKeyPair = params[0].get_str(); CMalleablePubKey malleablePubKey; - malleablePubKey.SetString(params[0].get_str()); + + if (pubKeyPair.size() == 138) { + CDataStream ssPublicBytes(ParseHex(pubKeyPair), SER_NETWORK, PROTOCOL_VERSION); + ssPublicBytes >> malleablePubKey; + } else + malleablePubKey.SetString(pubKeyPair); CPubKey R, vchPubKeyVariant; malleablePubKey.GetVariant(R, vchPubKeyVariant);