X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Frpcwallet.cpp;h=ff627c11adfdb21b1ed611a87dca8b9a2d7567c1;hb=5af8418fee23af1be2065382dda14a97034fdf56;hp=5ebff9c9cce13dc3bba0d24b4dc108d5fc4b9ed7;hpb=f728b0b90162f153b3094ce034f4fd3bccfea6a1;p=novacoin.git diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 5ebff9c..ff627c1 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1785,7 +1785,7 @@ Value reservebalance(const Array& params, bool fHelp) nAmount = (nAmount / CENT) * CENT; // round to cent if (nAmount < 0) throw runtime_error("amount cannot be negative.\n"); - mapArgs["-reservebalance"] = FormatMoney(nAmount).c_str(); + mapArgs["-reservebalance"] = FormatMoney(nAmount); } else { @@ -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; }