Display vin address in tx son

This commit is contained in:
jl777
2018-05-09 09:55:43 +03:00
parent b9b415654f
commit 1d03bae255

View File

@@ -138,8 +138,14 @@ void TxToJSONExpanded(const CTransaction& tx, const uint256 hashBlock, UniValue&
else {
in.push_back(Pair("txid", txin.prevout.hash.GetHex()));
in.push_back(Pair("vout", (int64_t)txin.prevout.n));
{
uint256 hash; CTransaction tx; CTxDestination address;
if (GetTransaction(txin.prevout.hash,tx,hash,false))
{
if (ExtractDestination(tx.scriptPubKey, address))
in.push_back(Pair("address", address.ToString()));
}
}
UniValue o(UniValue::VOBJ);
o.push_back(Pair("asm", txin.scriptSig.ToString()));
o.push_back(Pair("hex", HexStr(txin.scriptSig.begin(), txin.scriptSig.end())));