X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Frpcwallet.cpp;h=ff627c11adfdb21b1ed611a87dca8b9a2d7567c1;hb=5af8418fee23af1be2065382dda14a97034fdf56;hp=0c27a90eb6e70875585a835ad800c5cbcf8435a4;hpb=09bb63d7438ad8550288b852695dea78cff3babc;p=novacoin.git diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 0c27a90..ff627c1 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1912,23 +1912,28 @@ Value newmalleablekey(const Array& params, bool fHelp) return result; } -Value dumpmalleablekey(const Array& params, bool fHelp) +Value validatemalleablepubkey(const Array& params, bool fHelp) { if (fHelp || params.size() != 1) - throw runtime_error ( - "dumpmalleablekey \n" - "Dump the private and public key pairs, which correspond to provided key view.\n"); + throw runtime_error( + "validatemalleablekey \n" + "Check the validity and ownership for priovided malleable public key.\n"); - CMalleableKey mKey; - CMalleableKeyView keyView; - keyView.SetString(params[0].get_str()); - - if (!pwalletMain->GetMalleableKey(keyView, mKey)) - throw runtime_error("There is no such item in the wallet"); + CMalleablePubKey mpk; + bool isValid = mpk.SetString(params[0].get_str()); Object result; - result.push_back(Pair("PrivatePair", mKey.ToString())); - result.push_back(Pair("PublicPair", mKey.GetMalleablePubKey().ToString())); + result.push_back(Pair("isvalid", isValid)); + + if (isValid) + { + CMalleableKeyView view; + bool isMine = pwalletMain->GetMalleableView(mpk, view); + result.push_back(Pair("ismine", isMine)); + + if (isMine) + result.push_back(Pair("KeyView", view.ToString())); + } return result; }