proxyType proxy;
GetProxy(NET_IPV4, proxy);
- Object obj;
+ Object obj, diff;
obj.push_back(Pair("version", FormatFullVersion()));
obj.push_back(Pair("protocolversion",(int)PROTOCOL_VERSION));
obj.push_back(Pair("walletversion", pwalletMain->GetVersion()));
obj.push_back(Pair("connections", (int)vNodes.size()));
obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string())));
obj.push_back(Pair("ip", addrSeenByPeer.ToStringIP()));
- obj.push_back(Pair("difficulty", (double)GetDifficulty()));
+
+ diff.push_back(Pair("proof-of-work", GetDifficulty()));
+ diff.push_back(Pair("proof-of-stake", GetDifficulty(GetLastBlockIndex(pindexBest, true))));
+ obj.push_back(Pair("difficulty", diff));
+
obj.push_back(Pair("testnet", fTestNet));
obj.push_back(Pair("keypoololdest", (boost::int64_t)pwalletMain->GetOldestKeyPoolTime()));
obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize()));
if (fHelp || params.size() < 2 || params.size() > 4)
throw runtime_error(
"sendtoaddress <novacoinaddress> <amount> [comment] [comment-to]\n"
- "<amount> is a real and is rounded to the nearest 0.000001"
+ "<amount> is a real and is rounded to the nearest " + FormatMoney(MIN_TXOUT_AMOUNT)
+ HelpRequiringPassphrase());
CBitcoinAddress address(params[0].get_str());
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
- if (!wtx.IsConfirmed())
+ if (!wtx.IsTrusted())
continue;
int64 allGeneratedImmature, allGeneratedMature, allFee;
if (fHelp || params.size() < 3 || params.size() > 6)
throw runtime_error(
"sendfrom <fromaccount> <tonovacoinaddress> <amount> [minconf=1] [comment] [comment-to]\n"
- "<amount> is a real and is rounded to the nearest 0.000001"
+ "<amount> is a real and is rounded to the nearest " + FormatMoney(MIN_TXOUT_AMOUNT)
+ HelpRequiringPassphrase());
string strAccount = AccountFromValue(params[0]);
return ListReceived(params, true);
}
+static void MaybePushAddress(Object & entry, const CTxDestination &dest)
+{
+ CBitcoinAddress addr;
+ if (addr.Set(dest))
+ entry.push_back(Pair("address", addr.ToString()));
+}
+
void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDepth, bool fLong, Array& ret)
{
int64 nGeneratedImmature, nGeneratedMature, nFee;
{
Object entry;
entry.push_back(Pair("account", strSentAccount));
- entry.push_back(Pair("address", CBitcoinAddress(s.first).ToString()));
- entry.push_back(Pair("category", "send"));
+ MaybePushAddress(entry, s.first);
+
+ if (wtx.GetDepthInMainChain() < 0) {
+ entry.push_back(Pair("category", "conflicted"));
+ } else {
+ entry.push_back(Pair("category", "send"));
+ }
+
entry.push_back(Pair("amount", ValueFromAmount(-s.second)));
entry.push_back(Pair("fee", ValueFromAmount(-nFee)));
if (fLong)
{
Object entry;
entry.push_back(Pair("account", account));
- entry.push_back(Pair("address", CBitcoinAddress(r.first).ToString()));
+ MaybePushAddress(entry, r.first);
if (wtx.IsCoinBase())
{
if (wtx.GetDepthInMainChain() < 1)
uint256 hashBlock = 0;
if (GetTransaction(hash, tx, hashBlock))
{
- entry.push_back(Pair("txid", hash.GetHex()));
TxToJSON(tx, 0, entry);
if (hashBlock == 0)
entry.push_back(Pair("confirmations", 0));
{
CBlockIndex* pindex = (*mi).second;
if (pindex->IsInMainChain())
- {
entry.push_back(Pair("confirmations", 1 + nBestHeight - pindex->nHeight));
- entry.push_back(Pair("txntime", (boost::int64_t)tx.nTime));
- entry.push_back(Pair("time", (boost::int64_t)pindex->nTime));
- }
else
entry.push_back(Pair("confirmations", 0));
}