Skip to content

Commit c46ad17

Browse files
committed
Merge pull request #3668
3a1c20b Add raw transaction hex to `gettransaction` wallet RPC (Wladimir J. van der Laan)
2 parents ea06265 + 3a1c20b commit c46ad17

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/rpcwallet.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,8 @@ Value gettransaction(const Array& params, bool fHelp)
14481448
" \"amount\" : x.xxx (numeric) The amount in btc\n"
14491449
" }\n"
14501450
" ,...\n"
1451-
" ]\n"
1451+
" ],\n"
1452+
" \"hex\" : \"data\" (string) Raw data for transaction\n"
14521453
"}\n"
14531454

14541455
"\nbExamples\n"
@@ -1479,6 +1480,11 @@ Value gettransaction(const Array& params, bool fHelp)
14791480
ListTransactions(wtx, "*", 0, false, details);
14801481
entry.push_back(Pair("details", details));
14811482

1483+
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);
1484+
ssTx << wtx;
1485+
string strHex = HexStr(ssTx.begin(), ssTx.end());
1486+
entry.push_back(Pair("hex", strHex));
1487+
14821488
return entry;
14831489
}
14841490

0 commit comments

Comments
 (0)