Make ScriptSig anonymous struct an exported type.

The previous commit modified the Vin ScriptSig field to be a pointer to an
anonymous struct so it could be properly omitted.  However, the callers
need to be able to create a new object to assign to the field, so this
commit makes the previous anonymous struct an exported type named
ScriptSig.
This commit is contained in:
Dave Collins 2013-12-27 12:20:31 -06:00
parent 509bf830b1
commit d3b76da919

View file

@ -88,16 +88,21 @@ type TxRawDecodeResult struct {
Vout []Vout `json:"vout"`
}
// ScriptSig models a signature script. It is defined seperately since it only
// applies to non-coinbase. Therefore the field in the Vin structure needs
// to be a pointer.
type ScriptSig struct {
Asm string `json:"asm"`
Hex string `json:"hex"`
}
// Vin models parts of the tx data. It is defined seperately since both
// getrawtransaction and decoderawtransaction use the same structure.
type Vin struct {
Coinbase string `json:"coinbase,omitempty"`
Txid string `json:"txid,omitempty"`
Vout int `json:"vout,omitempty"`
ScriptSig *struct {
Asm string `json:"asm"`
Hex string `json:"hex"`
} `json:"scriptSig,omitempty"`
ScriptSig *ScriptSig `json:"scriptSig,omitempty"`
Sequence float64 `json:"sequence"`
}