// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2011-2012 The PPCoin developers
+// Copyright (c) 2012-2013 The NovaCoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
extern Value dumpprivkey(const Array& params, bool fHelp);
extern Value importprivkey(const Array& params, bool fHelp);
+extern CBigNum bnProofOfWorkLimit;
+
Object JSONRPCError(int code, const string& message)
{
Object error;
return strAccount;
}
-Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex)
+Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool fPrintTransactionDetail)
{
Object result;
result.push_back(Pair("hash", block.GetHash().GetHex()));
result.push_back(Pair("height", blockindex->nHeight));
result.push_back(Pair("version", block.nVersion));
result.push_back(Pair("merkleroot", block.hashMerkleRoot.GetHex()));
- result.push_back(Pair("time", (boost::int64_t)block.GetBlockTime()));
+ result.push_back(Pair("time", DateTimeStrFormat(block.GetBlockTime())));
result.push_back(Pair("nonce", (boost::uint64_t)block.nNonce));
result.push_back(Pair("bits", HexBits(block.nBits)));
result.push_back(Pair("difficulty", GetDifficulty(blockindex)));
- Array txhashes;
- BOOST_FOREACH (const CTransaction&tx, block.vtx)
- txhashes.push_back(tx.GetHash().GetHex());
- result.push_back(Pair("tx", txhashes));
-
+ result.push_back(Pair("mint", ValueFromAmount(blockindex->nMint)));
if (blockindex->pprev)
result.push_back(Pair("previousblockhash", blockindex->pprev->GetBlockHash().GetHex()));
if (blockindex->pnext)
result.push_back(Pair("nextblockhash", blockindex->pnext->GetBlockHash().GetHex()));
+ Array txinfo;
+ BOOST_FOREACH (const CTransaction& tx, block.vtx)
+ {
+ if (fPrintTransactionDetail)
+ {
+ txinfo.push_back(tx.ToStringShort());
+ txinfo.push_back(DateTimeStrFormat(tx.nTime));
+ BOOST_FOREACH(const CTxIn& txin, tx.vin)
+ txinfo.push_back(txin.ToStringShort());
+ BOOST_FOREACH(const CTxOut& txout, tx.vout)
+ txinfo.push_back(txout.ToStringShort());
+ }
+ else
+ txinfo.push_back(tx.GetHash().GetHex());
+ }
+ result.push_back(Pair("tx", txinfo));
return result;
}
if (fHelp || params.size() != 0)
throw runtime_error(
"stop\n"
- "Stop ppcoin server.");
+ "Stop novacoin server.");
// Shutdown will take long enough that the response should get back
StartShutdown();
- return "ppcoin server stopping";
+ return "novacoin server stopping";
}
if (fHelp || params.size() != 0)
throw runtime_error(
"getdifficulty\n"
- "Returns the proof-of-work difficulty as a multiple of the minimum difficulty.");
+ "Returns difficulty as a multiple of the minimum difficulty.");
- return GetDifficulty();
+ Object obj;
+ obj.push_back(Pair("proof-of-work", GetDifficulty()));
+ obj.push_back(Pair("proof-of-stake", GetDifficulty(GetLastBlockIndex(pindexBest, true))));
+ obj.push_back(Pair("search-interval", (int)nLastCoinStakeSearchInterval));
+ return obj;
}
obj.push_back(Pair("newmint", ValueFromAmount(pwalletMain->GetNewMint())));
obj.push_back(Pair("stake", ValueFromAmount(pwalletMain->GetStake())));
obj.push_back(Pair("blocks", (int)nBestHeight));
+ obj.push_back(Pair("moneysupply", ValueFromAmount(pindexBest->nMoneySupply)));
obj.push_back(Pair("connections", (int)vNodes.size()));
obj.push_back(Pair("proxy", (fUseProxy ? addrProxy.ToStringIPPort() : string())));
obj.push_back(Pair("ip", addrSeenByPeer.ToStringIP()));
if (fHelp || params.size() > 1)
throw runtime_error(
"getnewaddress [account]\n"
- "Returns a new ppcoin address for receiving payments. "
+ "Returns a new novacoin address for receiving payments. "
"If [account] is specified (recommended), it is added to the address book "
"so payments received with the address will be credited to [account].");
if (fHelp || params.size() != 1)
throw runtime_error(
"getaccountaddress <account>\n"
- "Returns the current ppcoin address for receiving payments to this account.");
+ "Returns the current novacoin address for receiving payments to this account.");
// Parse the account first so we don't generate a key if there's an error
string strAccount = AccountFromValue(params[0]);
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
- "setaccount <ppcoinaddress> <account>\n"
+ "setaccount <novacoinaddress> <account>\n"
"Sets the account associated with the given address.");
CBitcoinAddress address(params[0].get_str());
if (!address.IsValid())
- throw JSONRPCError(-5, "Invalid ppcoin address");
+ throw JSONRPCError(-5, "Invalid novacoin address");
string strAccount;
{
if (fHelp || params.size() != 1)
throw runtime_error(
- "getaccount <ppcoinaddress>\n"
+ "getaccount <novacoinaddress>\n"
"Returns the account associated with the given address.");
CBitcoinAddress address(params[0].get_str());
if (!address.IsValid())
- throw JSONRPCError(-5, "Invalid ppcoin address");
+ throw JSONRPCError(-5, "Invalid novacoin address");
string strAccount;
map<CBitcoinAddress, string>::iterator mi = pwalletMain->mapAddressBook.find(address);
{
if (pwalletMain->IsCrypted() && (fHelp || params.size() < 2 || params.size() > 4))
throw runtime_error(
- "sendtoaddress <ppcoinaddress> <amount> [comment] [comment-to]\n"
+ "sendtoaddress <novacoinaddress> <amount> [comment] [comment-to]\n"
"<amount> is a real and is rounded to the nearest 0.000001\n"
"requires wallet passphrase to be set with walletpassphrase first");
if (!pwalletMain->IsCrypted() && (fHelp || params.size() < 2 || params.size() > 4))
throw runtime_error(
- "sendtoaddress <ppcoinaddress> <amount> [comment] [comment-to]\n"
+ "sendtoaddress <novacoinaddress> <amount> [comment] [comment-to]\n"
"<amount> is a real and is rounded to the nearest 0.000001");
CBitcoinAddress address(params[0].get_str());
if (!address.IsValid())
- throw JSONRPCError(-5, "Invalid ppcoin address");
+ throw JSONRPCError(-5, "Invalid novacoin address");
// Amount
int64 nAmount = AmountFromValue(params[1]);
+ if (nAmount < MIN_TXOUT_AMOUNT)
+ throw JSONRPCError(-101, "Send amount too small");
// Wallet comments
CWalletTx wtx;
{
if (fHelp || params.size() != 2)
throw runtime_error(
- "signmessage <ppcoinaddress> <message>\n"
+ "signmessage <novacoinaddress> <message>\n"
"Sign a message with the private key of an address");
if (pwalletMain->IsLocked())
{
if (fHelp || params.size() != 3)
throw runtime_error(
- "verifymessage <ppcoinaddress> <signature> <message>\n"
+ "verifymessage <novacoinaddress> <signature> <message>\n"
"Verify a signed message");
string strAddress = params[0].get_str();
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
- "getreceivedbyaddress <ppcoinaddress> [minconf=1]\n"
- "Returns the total amount received by <ppcoinaddress> in transactions with at least [minconf] confirmations.");
+ "getreceivedbyaddress <novacoinaddress> [minconf=1]\n"
+ "Returns the total amount received by <novacoinaddress> in transactions with at least [minconf] confirmations.");
// Bitcoin address
CBitcoinAddress address = CBitcoinAddress(params[0].get_str());
CScript scriptPubKey;
if (!address.IsValid())
- throw JSONRPCError(-5, "Invalid ppcoin address");
+ throw JSONRPCError(-5, "Invalid novacoin address");
scriptPubKey.SetBitcoinAddress(address);
if (!IsMine(*pwalletMain,scriptPubKey))
return (double)0.0;
{
if (pwalletMain->IsCrypted() && (fHelp || params.size() < 3 || params.size() > 6))
throw runtime_error(
- "sendfrom <fromaccount> <toppcoinaddress> <amount> [minconf=1] [comment] [comment-to]\n"
+ "sendfrom <fromaccount> <tonovacoinaddress> <amount> [minconf=1] [comment] [comment-to]\n"
"<amount> is a real and is rounded to the nearest 0.000001\n"
"requires wallet passphrase to be set with walletpassphrase first");
if (!pwalletMain->IsCrypted() && (fHelp || params.size() < 3 || params.size() > 6))
throw runtime_error(
- "sendfrom <fromaccount> <toppcoinaddress> <amount> [minconf=1] [comment] [comment-to]\n"
+ "sendfrom <fromaccount> <tonovacoinaddress> <amount> [minconf=1] [comment] [comment-to]\n"
"<amount> is a real and is rounded to the nearest 0.000001");
string strAccount = AccountFromValue(params[0]);
CBitcoinAddress address(params[1].get_str());
if (!address.IsValid())
- throw JSONRPCError(-5, "Invalid ppcoin address");
+ throw JSONRPCError(-5, "Invalid novacoin address");
int64 nAmount = AmountFromValue(params[2]);
+ if (nAmount < MIN_TXOUT_AMOUNT)
+ throw JSONRPCError(-101, "Send amount too small");
int nMinDepth = 1;
if (params.size() > 3)
nMinDepth = params[3].get_int();
{
CBitcoinAddress address(s.name_);
if (!address.IsValid())
- throw JSONRPCError(-5, string("Invalid ppcoin address:")+s.name_);
+ throw JSONRPCError(-5, string("Invalid novacoin address:")+s.name_);
if (setAddress.count(address))
throw JSONRPCError(-8, string("Invalid parameter, duplicated address: ")+s.name_);
CScript scriptPubKey;
scriptPubKey.SetBitcoinAddress(address);
int64 nAmount = AmountFromValue(s.value_);
+ if (nAmount < MIN_TXOUT_AMOUNT)
+ throw JSONRPCError(-101, "Send amount too small");
totalAmount += nAmount;
vecSend.push_back(make_pair(scriptPubKey, nAmount));
if (pwalletMain->IsLocked())
throw JSONRPCError(-13, "Error: Please enter the wallet passphrase with walletpassphrase first.");
- if (fWalletUnlockStakeOnly)
- throw JSONRPCError(-13, "Error: Wallet unlocked for coinstake only.");
+ if (fWalletUnlockMintOnly)
+ throw JSONRPCError(-13, "Error: Wallet unlocked for block minting only.");
// Check funds
int64 nBalance = GetAccountBalance(strAccount, nMinDepth);
{
string msg = "addmultisigaddress <nrequired> <'[\"key\",\"key\"]'> [account]\n"
"Add a nrequired-to-sign multisignature address to the wallet\"\n"
- "each key is a bitcoin address or hex-encoded public key\n"
+ "each key is a novacoin address or hex-encoded public key\n"
"If [account] is specified, assign address to [account].";
throw runtime_error(msg);
}
{
if (pwalletMain->IsCrypted() && (fHelp || params.size() < 2 || params.size() > 3))
throw runtime_error(
- "walletpassphrase <passphrase> <timeout> [stakeonly]\n"
+ "walletpassphrase <passphrase> <timeout> [mintonly]\n"
"Stores the wallet decryption key in memory for <timeout> seconds.\n"
- "stakeonly is optional true/false allowing only stake creation.");
+ "mintonly is optional true/false allowing only block minting.");
if (fHelp)
return true;
if (!pwalletMain->IsCrypted())
// ppcoin: if user OS account compromised prevent trivial sendmoney commands
if (params.size() > 2)
- fWalletUnlockStakeOnly = params[2].get_bool();
+ fWalletUnlockMintOnly = params[2].get_bool();
else
- fWalletUnlockStakeOnly = false;
+ fWalletUnlockMintOnly = false;
return Value::null;
}
// slack space in .dat files; that is bad if the old data is
// unencrypted private keys. So:
StartShutdown();
- return "wallet encrypted; ppcoin server stopping, restart to run with encrypted wallet";
+ return "wallet encrypted; novacoin server stopping, restart to run with encrypted wallet";
}
{
if (fHelp || params.size() != 1)
throw runtime_error(
- "validateaddress <ppcoinaddress>\n"
- "Return information about <ppcoinaddress>.");
+ "validateaddress <novacoinaddress>\n"
+ "Return information about <novacoinaddress>.");
CBitcoinAddress address(params[0].get_str());
bool isValid = address.IsValid();
"If [data] is specified, tries to solve the block and returns true if it was successful.");
if (vNodes.empty())
- throw JSONRPCError(-9, "PPCoin is not connected!");
+ throw JSONRPCError(-9, "NovaCoin is not connected!");
if (IsInitialBlockDownload())
- throw JSONRPCError(-10, "PPCoin is downloading blocks...");
+ throw JSONRPCError(-10, "NovaCoin is downloading blocks...");
typedef map<uint256, pair<CBlock*, CScript> > mapNewBlock_t;
static mapNewBlock_t mapNewBlock;
nStart = GetTime();
// Create new block
- pblock = CreateNewBlock(pwalletMain, true);
+ pblock = CreateNewBlock(pwalletMain);
if (!pblock)
throw JSONRPCError(-7, "Out of memory");
vNewBlock.push_back(pblock);
pblock->vtx[0].vin[0].scriptSig = mapNewBlock[pdata->hashMerkleRoot].second;
pblock->hashMerkleRoot = pblock->BuildMerkleTree();
if (!pblock->SignBlock(*pwalletMain))
- throw JSONRPCError(-100, "Unable to sign block");
+ throw JSONRPCError(-100, "Unable to sign block, wallet locked?");
return CheckWork(pblock, *pwalletMain, reservekey);
}
if (params.size() == 0)
{
if (vNodes.empty())
- throw JSONRPCError(-9, "PPCoin is not connected!");
+ throw JSONRPCError(-9, "NovaCoin is not connected!");
if (IsInitialBlockDownload())
- throw JSONRPCError(-10, "PPCoin is downloading blocks...");
+ throw JSONRPCError(-10, "NovaCoin is downloading blocks...");
static CReserveKey reservekey(pwalletMain);
CBlock pblock;
ssBlock >> pblock;
- return ProcessBlock(NULL, &pblock);
+ static CReserveKey reservekey(pwalletMain);
+
+ if(!pblock.SignBlock(*pwalletMain))
+ throw JSONRPCError(-100, "Unable to sign block, wallet locked?");
+
+ return CheckWork(&pblock, *pwalletMain, reservekey);
}
}
+Value getnewpubkey(const Array& params, bool fHelp)
+{
+ if (fHelp || params.size() > 1)
+ throw runtime_error(
+ "getnewpubkey [account]\n"
+ "Returns new public key for coinbase generation.");
+
+ // Parse the account first so we don't generate a key if there's an error
+ string strAccount;
+ if (params.size() > 0)
+ strAccount = AccountFromValue(params[0]);
+
+ if (!pwalletMain->IsLocked())
+ pwalletMain->TopUpKeyPool();
+
+ // Generate a new key that is added to wallet
+ std::vector<unsigned char> newKey = pwalletMain->GenerateNewKey(false);
+
+ if(!newKey.size())
+ throw JSONRPCError(-12, "Error: Unable to create key");
+
+ CBitcoinAddress address(newKey);
+ pwalletMain->SetAddressBookName(address, strAccount);
+
+ return HexStr(newKey.begin(), newKey.end());
+}
+
+
Value getblockhash(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
Value getblock(const Array& params, bool fHelp)
{
- if (fHelp || params.size() != 1)
+ if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
- "getblock <hash>\n"
+ "getblock <hash> [txinfo]\n"
+ "txinfo optional to print more detailed tx info\n"
"Returns details of a block with given block-hash.");
std::string strHash = params[0].get_str();
CBlockIndex* pblockindex = mapBlockIndex[hash];
block.ReadFromDisk(pblockindex, true);
- return blockToJSON(block, pblockindex);
+ return blockToJSON(block, pblockindex, params.size() > 1 ? params[1].get_bool() : false);
}
result.push_back(Pair("synccheckpoint", Checkpoints::hashSyncCheckpoint.ToString().c_str()));
pindexCheckpoint = mapBlockIndex[Checkpoints::hashSyncCheckpoint];
result.push_back(Pair("height", pindexCheckpoint->nHeight));
- result.push_back(Pair("timestamp", DateTimeStrFormat("%x %H:%M:%S", pindexCheckpoint->GetBlockTime()).c_str()));
-
+ result.push_back(Pair("timestamp", DateTimeStrFormat(pindexCheckpoint->GetBlockTime()).c_str()));
+ if (mapArgs.count("-checkpointkey"))
+ result.push_back(Pair("checkpointmaster", true));
+
return result;
}
nAmount = (nAmount / CENT) * CENT; // round to cent
if (nAmount < 0)
throw runtime_error("amount cannot be negative.\n");
- // TODO: handle persistence of nBalanceReserve
- // settings removed since bitcoin 0.6
- // WriteSetting("nBalanceReserve", nBalanceReserve = nAmount);
- nBalanceReserve = nAmount;
+ mapArgs["-reservebalance"] = FormatMoney(nAmount).c_str();
}
else
{
if (params.size() > 1)
throw runtime_error("cannot specify amount to turn off reserve.\n");
- // TODO: handle persistence of nBalanceReserve
- // settings removed since bitcoin 0.6
- // WriteSetting("nBalanceReserve", nBalanceReserve = 0);
- nBalanceReserve = 0;
+ mapArgs["-reservebalance"] = "0";
}
}
Object result;
- result.push_back(Pair("reserve", (nBalanceReserve > 0)));
- result.push_back(Pair("amount", ValueFromAmount(nBalanceReserve)));
+ int64 nReserveBalance = 0;
+ if (mapArgs.count("-reservebalance") && !ParseMoney(mapArgs["-reservebalance"], nReserveBalance))
+ throw runtime_error("invalid reserve balance amount\n");
+ result.push_back(Pair("reserve", (nReserveBalance > 0)));
+ result.push_back(Pair("amount", ValueFromAmount(nReserveBalance)));
return result;
}
int nMismatchSpent;
int64 nBalanceInQuestion;
- if (!pwalletMain->CheckSpentCoins(nMismatchSpent, nBalanceInQuestion))
+ pwalletMain->FixSpentCoins(nMismatchSpent, nBalanceInQuestion, true);
+ Object result;
+ if (nMismatchSpent == 0)
+ result.push_back(Pair("wallet check passed", true));
+ else
{
- Object result;
result.push_back(Pair("mismatched spent coins", nMismatchSpent));
result.push_back(Pair("amount in question", ValueFromAmount(nBalanceInQuestion)));
- return result;
}
- return Value::null;
+ return result;
}
pwalletMain->FixSpentCoins(nMismatchSpent, nBalanceInQuestion);
Object result;
if (nMismatchSpent == 0)
- {
result.push_back(Pair("wallet check passed", true));
- }
else
{
result.push_back(Pair("mismatched spent coins", nMismatchSpent));
// ThreadRPCServer: holds cs_main and acquiring cs_vSend in alert.RelayTo()/PushMessage()/BeginMessage()
Value sendalert(const Array& params, bool fHelp)
{
- if (fHelp || params.size() < 5)
+ if (fHelp || params.size() < 6)
throw runtime_error(
- "sendalert <message> <privatekey> <minver> <maxver> <id> [cancelupto]\n"
+ "sendalert <message> <privatekey> <minver> <maxver> <priority> <id> [cancelupto]\n"
"<message> is the alert text message\n"
"<privatekey> is hex string of alert master private key\n"
- "<minver> is the minimum applicable client version\n"
- "<maxver> is the maximum applicable client version\n"
+ "<minver> is the minimum applicable internal client version\n"
+ "<maxver> is the maximum applicable internal client version\n"
+ "<priority> is integer priority number\n"
"<id> is the alert id\n"
"[cancelupto] cancels all alert id's up to this number\n"
- "Returns true or false.");
+ "Returns true or false.");
CAlert alert;
CKey key;
alert.strStatusBar = params[0].get_str();
alert.nMinVer = params[2].get_int();
alert.nMaxVer = params[3].get_int();
- alert.nID = params[4].get_int();
- if (params.size() > 5)
- alert.nCancel = params[5].get_int();
+ alert.nPriority = params[4].get_int();
+ alert.nID = params[5].get_int();
+ if (params.size() > 6)
+ alert.nCancel = params[6].get_int();
alert.nVersion = PROTOCOL_VERSION;
alert.nRelayUntil = GetAdjustedTime() + 365*24*60*60;
alert.nExpiration = GetAdjustedTime() + 365*24*60*60;
- alert.nPriority = 1;
CDataStream sMsg(SER_NETWORK, PROTOCOL_VERSION);
sMsg << (CUnsignedAlert)alert;
result.push_back(Pair("nVersion", alert.nVersion));
result.push_back(Pair("nMinVer", alert.nMinVer));
result.push_back(Pair("nMaxVer", alert.nMaxVer));
+ result.push_back(Pair("nPriority", alert.nPriority));
result.push_back(Pair("nID", alert.nID));
if (alert.nCancel > 0)
result.push_back(Pair("nCancel", alert.nCancel));
return result;
}
-// ppcoin: send checkpoint
-Value sendcheckpoint(const Array& params, bool fHelp)
-{
- if (fHelp || params.size() > 2 || params.size() < 1 )
- throw runtime_error(
- "sendcheckpoint <privatekey> [checkpointhash]\n"
- "<privatekey> is hex string of checkpoint master private key\n"
- "<checkpointhash> is the hash of checkpoint block\n");
-
- CSyncCheckpoint checkpoint;
- CKey key;
-
- // TODO: omit checkpointhash parameter
- if (params.size() > 1)
- {
- checkpoint.hashCheckpoint = uint256(params[1].get_str());
- if (!mapBlockIndex.count(checkpoint.hashCheckpoint))
- throw runtime_error(
- "Provided checkpoint block is not on main chain\n");
- }
- else
- {
- checkpoint.hashCheckpoint = Checkpoints::AutoSelectSyncCheckpoint();
- if (checkpoint.hashCheckpoint == Checkpoints::hashSyncCheckpoint)
- throw runtime_error(
- "Unable to select a more recent sync-checkpoint");
- }
-
- CDataStream sMsg(SER_NETWORK, PROTOCOL_VERSION);
- sMsg << (CUnsignedSyncCheckpoint)checkpoint;
- checkpoint.vchMsg = vector<unsigned char>(sMsg.begin(), sMsg.end());
-
- vector<unsigned char> vchPrivKey = ParseHex(params[0].get_str());
- key.SetPrivKey(CPrivKey(vchPrivKey.begin(), vchPrivKey.end())); // if key is not correct openssl may crash
- if (!key.Sign(Hash(checkpoint.vchMsg.begin(), checkpoint.vchMsg.end()), checkpoint.vchSig))
- throw runtime_error(
- "Unable to sign checkpoint, check private key?\n");
-
- if(!checkpoint.ProcessSyncCheckpoint(NULL))
- throw runtime_error(
- "Failed to process checkpoint.\n");
- // Relay checkpoint
- {
- LOCK(cs_vNodes);
- BOOST_FOREACH(CNode* pnode, vNodes)
- checkpoint.RelayTo(pnode);
- }
-
- Object result;
- result.push_back(Pair("checkpoint", Checkpoints::hashSyncCheckpoint.ToString().c_str()));
- result.push_back(Pair("height", mapBlockIndex[Checkpoints::hashSyncCheckpoint]->nHeight));
- result.push_back(Pair("timestamp", DateTimeStrFormat("%x %H:%M:%S", mapBlockIndex[Checkpoints::hashSyncCheckpoint]->GetBlockTime()).c_str()));
- return result;
-}
//
{ "getinfo", &getinfo, true },
{ "getmininginfo", &getmininginfo, true },
{ "getnewaddress", &getnewaddress, true },
+ { "getnewpubkey", &getnewpubkey, true },
{ "getaccountaddress", &getaccountaddress, true },
{ "setaccount", &setaccount, true },
{ "getaccount", &getaccount, false },
{ "repairwallet", &repairwallet, false},
{ "makekeypair", &makekeypair, false},
{ "sendalert", &sendalert, false},
- { "sendcheckpoint", &sendcheckpoint, false},
};
CRPCTable::CRPCTable()
{
ostringstream s;
s << "POST / HTTP/1.1\r\n"
- << "User-Agent: ppcoin-json-rpc/" << FormatFullVersion() << "\r\n"
+ << "User-Agent: novacoin-json-rpc/" << FormatFullVersion() << "\r\n"
<< "Host: 127.0.0.1\r\n"
<< "Content-Type: application/json\r\n"
<< "Content-Length: " << strMsg.size() << "\r\n"
if (nStatus == 401)
return strprintf("HTTP/1.0 401 Authorization Required\r\n"
"Date: %s\r\n"
- "Server: ppcoin-json-rpc/%s\r\n"
+ "Server: novacoin-json-rpc/%s\r\n"
"WWW-Authenticate: Basic realm=\"jsonrpc\"\r\n"
"Content-Type: text/html\r\n"
"Content-Length: 296\r\n"
"Connection: close\r\n"
"Content-Length: %d\r\n"
"Content-Type: application/json\r\n"
- "Server: ppcoin-json-rpc/%s\r\n"
+ "Server: novacoin-json-rpc/%s\r\n"
"\r\n"
"%s",
nStatus,
{
unsigned char rand_pwd[32];
RAND_bytes(rand_pwd, 32);
- string strWhatAmI = "To use ppcoind";
+ string strWhatAmI = "To use novacoind";
if (mapArgs.count("-server"))
strWhatAmI = strprintf(_("To use the %s option"), "\"-server\"");
else if (mapArgs.count("-daemon"))
if (strMethod == "listreceivedbyaccount" && n > 1) ConvertTo<bool>(params[1]);
if (strMethod == "getbalance" && n > 1) ConvertTo<boost::int64_t>(params[1]);
if (strMethod == "getblockhash" && n > 0) ConvertTo<boost::int64_t>(params[0]);
+ if (strMethod == "getblock" && n > 1) ConvertTo<bool>(params[1]);
if (strMethod == "move" && n > 2) ConvertTo<double>(params[2]);
if (strMethod == "move" && n > 3) ConvertTo<boost::int64_t>(params[3]);
if (strMethod == "sendfrom" && n > 2) ConvertTo<double>(params[2]);
if (strMethod == "sendalert" && n > 3) ConvertTo<boost::int64_t>(params[3]);
if (strMethod == "sendalert" && n > 4) ConvertTo<boost::int64_t>(params[4]);
if (strMethod == "sendalert" && n > 5) ConvertTo<boost::int64_t>(params[5]);
+ if (strMethod == "sendalert" && n > 6) ConvertTo<boost::int64_t>(params[6]);
if (strMethod == "sendmany" && n > 1)
{
string s = params[1].get_str();