diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-02-13 18:37:52 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-02-13 18:38:25 +0100 |
commit | c46ad177856a0c4f465c502513e151e5f07bf278 (patch) | |
tree | 6b77ef57a28b03a3ebcd8714344cc7c9e4cd540d /src | |
parent | ea062655e045b68d568d2faf7abe946deb00d46d (diff) | |
parent | 3a1c20b77a610edf5d7e8b1e5cbd47062cae7fcd (diff) |
Merge pull request #3668
3a1c20b Add raw transaction hex to `gettransaction` wallet RPC (Wladimir J. van der Laan)
Diffstat (limited to 'src')
-rw-r--r-- | src/rpcwallet.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 7045225825..51e9aabecc 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1448,7 +1448,8 @@ Value gettransaction(const Array& params, bool fHelp) " \"amount\" : x.xxx (numeric) The amount in btc\n" " }\n" " ,...\n" - " ]\n" + " ],\n" + " \"hex\" : \"data\" (string) Raw data for transaction\n" "}\n" "\nbExamples\n" @@ -1479,6 +1480,11 @@ Value gettransaction(const Array& params, bool fHelp) ListTransactions(wtx, "*", 0, false, details); entry.push_back(Pair("details", details)); + CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); + ssTx << wtx; + string strHex = HexStr(ssTx.begin(), ssTx.end()); + entry.push_back(Pair("hex", strHex)); + return entry; } |