Display vin address in tx son
This commit is contained in:
@@ -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())));
|
||||
|
||||
Reference in New Issue
Block a user