void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry)
{
entry.push_back(Pair("txid", tx.GetHash().GetHex()));
+ entry.push_back(Pair("metahash", tx.GetMetaHash().GetHex()));
entry.push_back(Pair("version", tx.nVersion));
entry.push_back(Pair("time", (boost::int64_t)tx.nTime));
entry.push_back(Pair("locktime", (boost::int64_t)tx.nLockTime));
fVerbose = (params[1].get_int() != 0);
CTransaction tx;
- uint256 hashBlock = 0;
+ uint256 hashBlock = 0; // trying to find transaction in the blockchain
if (!GetTransaction(hash, tx, hashBlock, true))
- throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No information available about transaction");
+ {
+ if (pwalletMain->mapWallet.count(hash))
+ tx = (CTransaction)pwalletMain->mapWallet[hash]; // get transaction from wallet
+ else
+ throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No information available about transaction");
+ }
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);
ssTx << tx;