Add txid to inputs

This commit is contained in:
wlc- 2018-10-10 20:36:13 +02:00 committed by GitHub
parent d3d346a212
commit 3ad9b33b17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -240,6 +240,7 @@ type addressHistoryIndexes struct {
}
type txInputs struct {
Txid *string `json:"txid"`
OutputIndex int `json:"outputIndex"`
Script *string `json:"script"`
// ScriptAsm *string `json:"scriptAsm"`
@ -301,8 +302,10 @@ func txToResTx(tx *api.Tx) resTx {
inputs := make([]txInputs, len(tx.Vin))
for i := range tx.Vin {
vin := &tx.Vin[i]
txid := vin.Txid
script := vin.ScriptSig.Hex
input := txInputs{
Txid: &txid,
Script: &script,
Sequence: int64(vin.Sequence),
OutputIndex: int(vin.Vout),