Browse Source

Merge pull request #3668

3a1c20b Add raw transaction hex to `gettransaction` wallet RPC (Wladimir J. van der Laan)
0.10
Wladimir J. van der Laan 11 years ago
parent
commit
c46ad17785
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 8
      src/rpcwallet.cpp

8
src/rpcwallet.cpp

@ -1448,7 +1448,8 @@ Value gettransaction(const Array& params, bool fHelp) @@ -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) @@ -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;
}

Loading…
Cancel
Save