{
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());
+ Object entry;
+
+ entry.push_back(Pair("txid", tx.GetHash().GetHex()));
+ TxToJSON(tx, entry);
+ entry.push_back(Pair("time", DateTimeStrFormat(tx.nTime)));
+
+ txinfo.push_back(entry);
}
else
txinfo.push_back(tx.GetHash().GetHex());
}
+
result.push_back(Pair("tx", txinfo));
+ result.push_back(Pair("signature", HexStr(block.vchBlockSig.begin(), block.vchBlockSig.end())));
+
return result;
}
return ret;
}
-/*
-Value gettransaction(const Array& params, bool fHelp)
-{
- if (fHelp || params.size() != 1)
- throw runtime_error(
- "gettransaction <txid>\n"
- "Get detailed information about <txid>");
-
- uint256 hash;
- hash.SetHex(params[0].get_str());
-
- Object entry;
-
- if (!pwalletMain->mapWallet.count(hash))
- throw JSONRPCError(-5, "Invalid or non-wallet transaction id");
- const CWalletTx& wtx = pwalletMain->mapWallet[hash];
-
- int64 nCredit = wtx.GetCredit();
- int64 nDebit = wtx.GetDebit();
- int64 nNet = nCredit - nDebit;
- int64 nFee = (wtx.IsFromMe() ? wtx.GetValueOut() - nDebit : 0);
-
- entry.push_back(Pair("amount", ValueFromAmount(nNet - nFee)));
- if (wtx.IsFromMe())
- entry.push_back(Pair("fee", ValueFromAmount(nFee)));
-
- WalletTxToJSON(pwalletMain->mapWallet[hash], entry);
-
- Array details;
- ListTransactions(pwalletMain->mapWallet[hash], "*", 0, false, details);
- entry.push_back(Pair("details", details));
-
- return entry;
-}
-*/
-
-
Value gettransaction(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
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
if (!pblock->SignBlock(*pwalletMain))
throw JSONRPCError(-100, "Unable to sign block, wallet locked?");
+
return CheckWork(pblock, *pwalletMain, reservekey);
}
}
pwalletMain->TopUpKeyPool();
// Generate a new key that is added to wallet
- std::vector<unsigned char> newKey = pwalletMain->GenerateNewKey(false);
+ std::vector<unsigned char> newKey = pwalletMain->GenerateNewKey(true);
if(!newKey.size())
throw JSONRPCError(-12, "Error: Unable to create key");
{ "signmessage", &signmessage, false },
{ "verifymessage", &verifymessage, false },
{ "getwork", &getwork, true },
- { "getworkex", &getworkex, true },
+ { "getworkex", &getworkex, true },
{ "listaccounts", &listaccounts, false },
{ "settxfee", &settxfee, false },
{ "getmemorypool", &getmemorypool, true },