From 086e4fae8b918e0844d7a306acdd0683bec729db Mon Sep 17 00:00:00 2001 From: CryptoManiac Date: Sat, 19 Jul 2014 22:54:06 +0400 Subject: [PATCH] RPC: return raw transactions instead of parsed representation. This change allows us to dramatically reduce electrum-server RPC overhead, but breaks compatibility. If you are using script which depends on this functionality then add decoderawtransaction to get a parsed tx representation. --- src/rpcblockchain.cpp | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index d8860d5..8d2f389 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -125,12 +125,11 @@ Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool fPri { if (fPrintTransactionDetail) { - Object entry; + CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); + ssTx << tx; + string strHex = HexStr(ssTx.begin(), ssTx.end()); - entry.push_back(Pair("txid", tx.GetHash().GetHex())); - TxToJSON(tx, 0, entry); - - txinfo.push_back(entry); + txinfo.push_back(strHex); } else txinfo.push_back(tx.GetHash().GetHex()); -- 1.7.1