From d780dc76b9881b3c55ea9269577084286bab6292 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Tue, 8 Oct 2013 16:18:06 -0300 Subject: [PATCH] getrawtransaction using username instead of hash --- src/rpcrawtransaction.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 91b7d6a2..ca529b26 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -100,6 +100,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry) CBlockIndex* pindex = (*mi).second; if (pindex->IsInMainChain()) { + entry.push_back(Pair("height", pindex->nHeight)); entry.push_back(Pair("confirmations", 1 + nBestHeight - pindex->nHeight)); entry.push_back(Pair("time", (boost::int64_t)pindex->nTime)); entry.push_back(Pair("blocktime", (boost::int64_t)pindex->nTime)); @@ -114,13 +115,14 @@ Value getrawtransaction(const Array& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 2) throw runtime_error( - "getrawtransaction [verbose=0]\n" + "getrawtransaction [verbose=0]\n" "If verbose=0, returns a string that is\n" "serialized, hex-encoded data for .\n" "If verbose is non-zero, returns an Object\n" - "with information about ."); + "with information about transaction."); - uint256 hash = ParseHashV(params[0], "parameter 1"); + //uint256 hash = ParseHashV(params[0], "parameter 1"); + uint256 hash = SerializeHash(params[0].get_str()); bool fVerbose = false; if (params.size() > 1)