RPC: Add new methods suitable for malleable key pairs management;
[novacoin.git] / src / bitcoinrpc.cpp
index 1f55825..c6b64fe 100644 (file)
@@ -253,6 +253,7 @@ static const CRPCCommand vRPCCommands[] =
     { "scaninput",              &scaninput,              true,   true },
     { "getnewaddress",          &getnewaddress,          true,   false },
     { "getnettotals",           &getnettotals,           true,   true  },
+    { "ntptime",                &ntptime,                true,   true  },
     { "getaccountaddress",      &getaccountaddress,      true,   false },
     { "setaccount",             &setaccount,             true,   false },
     { "getaccount",             &getaccount,             false,  false },
@@ -315,6 +316,11 @@ static const CRPCCommand vRPCCommands[] =
     { "repairwallet",           &repairwallet,           false,  true},
     { "resendtx",               &resendtx,               false,  true},
     { "makekeypair",            &makekeypair,            false,  true},
+    { "newmalleablekey",        &newmalleablekey,        false,  false},
+    { "adjustmalleablekey",     &adjustmalleablekey,     false,  false},
+    { "adjustmalleablepubkey",  &adjustmalleablepubkey,  false,  false},
+    { "listmalleableviews",     &listmalleableviews,     false,  false},
+    { "dumpmalleablekey",       &dumpmalleablekey,       false,  false},
     { "sendalert",              &sendalert,              false,  false},
 };
 
@@ -1180,7 +1186,7 @@ Array RPCConvertValues(const std::string &strMethod, const std::vector<std::stri
     BOOST_FOREACH(const std::string &param, strParams)
         params.push_back(param);
 
-    int n = params.size();
+    size_t n = params.size();
 
     //
     // Special case non-string parameter types
@@ -1216,9 +1222,7 @@ Array RPCConvertValues(const std::string &strMethod, const std::vector<std::stri
     if (strMethod == "getblocktemplate"       && n > 0) ConvertTo<Object>(params[0]);
     if (strMethod == "listsinceblock"         && n > 1) ConvertTo<int64_t>(params[1]);
 
-    if (strMethod == "scaninput"              && n > 1) ConvertTo<int>(params[1]);
-    if (strMethod == "scaninput"              && n > 2) ConvertTo<double>(params[2]);
-    if (strMethod == "scaninput"              && n > 3) ConvertTo<int>(params[3]);
+    if (strMethod == "scaninput"              && n > 0) ConvertTo<Object>(params[0]);
 
     if (strMethod == "sendalert"              && n > 2) ConvertTo<int64_t>(params[2]);
     if (strMethod == "sendalert"              && n > 3) ConvertTo<int64_t>(params[3]);