Merge pull request #191 from novacoin-project/scaninput
authorCryptoManiac <CryptoManiac@users.noreply.github.com>
Wed, 1 Apr 2015 20:37:59 +0000 (23:37 +0300)
committerCryptoManiac <CryptoManiac@users.noreply.github.com>
Wed, 1 Apr 2015 20:37:59 +0000 (23:37 +0300)
Scaninput

1  2 
src/bitcoinrpc.cpp

diff --combined src/bitcoinrpc.cpp
@@@ -250,6 -250,7 +250,7 @@@ static const CRPCCommand vRPCCommands[
      { "getinfo",                &getinfo,                true,   false },
      { "getsubsidy",             &getsubsidy,             true,   false },
      { "getmininginfo",          &getmininginfo,          true,   false },
+     { "scaninput",              &scaninput,              true,   true },
      { "getnewaddress",          &getnewaddress,          true,   false },
      { "getnettotals",           &getnettotals,           true,   true  },
      { "getaccountaddress",      &getaccountaddress,      true,   false },
@@@ -361,7 -362,15 +362,7 @@@ string HTTPPost(const string& strMsg, c
  
  string rfc1123Time()
  {
 -    char buffer[64];
 -    time_t now;
 -    time(&now);
 -    struct tm* now_gmt = gmtime(&now);
 -    string locale(setlocale(LC_TIME, NULL));
 -    setlocale(LC_TIME, "C"); // we want POSIX (aka "C") weekday/month strings
 -    strftime(buffer, sizeof(buffer), "%a, %d %b %Y %H:%M:%S +0000", now_gmt);
 -    setlocale(LC_TIME, locale.c_str());
 -    return string(buffer);
 +    return DateTimeStrFormat("%a, %d %b %Y %H:%M:%S +0000", GetTime());
  }
  
  static string HTTPReply(int nStatus, const string& strMsg, bool keepalive)
@@@ -1211,6 -1220,10 +1212,10 @@@ Array RPCConvertValues(const std::strin
      if (strMethod == "getblocktemplate"       && n > 0) ConvertTo<Object>(params[0]);
      if (strMethod == "listsinceblock"         && n > 1) ConvertTo<boost::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 == "sendalert"              && n > 2) ConvertTo<boost::int64_t>(params[2]);
      if (strMethod == "sendalert"              && n > 3) ConvertTo<boost::int64_t>(params[3]);
      if (strMethod == "sendalert"              && n > 4) ConvertTo<boost::int64_t>(params[4]);