mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 21:12:48 +01:00
Add raw transaction hex to gettransaction
wallet RPC
This allows getting raw transaction data from the wallet even if the transaction is no longer in the blockchain / mempool (for example if it got orphaned due to malleability abuse).
This commit is contained in:
parent
ea062655e0
commit
3a1c20b77a
@ -1448,7 +1448,8 @@ Value gettransaction(const Array& params, bool fHelp)
|
|||||||
" \"amount\" : x.xxx (numeric) The amount in btc\n"
|
" \"amount\" : x.xxx (numeric) The amount in btc\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
" ,...\n"
|
" ,...\n"
|
||||||
" ]\n"
|
" ],\n"
|
||||||
|
" \"hex\" : \"data\" (string) Raw data for transaction\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
|
|
||||||
"\nbExamples\n"
|
"\nbExamples\n"
|
||||||
@ -1479,6 +1480,11 @@ Value gettransaction(const Array& params, bool fHelp)
|
|||||||
ListTransactions(wtx, "*", 0, false, details);
|
ListTransactions(wtx, "*", 0, false, details);
|
||||||
entry.push_back(Pair("details", 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;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user