Correct Vin ScriptSig to properly omit when empty.

In order for a field which is a struct to be omitted from JSON
marshal/unmarshal, it must be a pointer so the json package can tell when
it's empty (when it's nil).
This commit is contained in:
Dave Collins 2013-12-27 11:27:52 -06:00
parent 1855c19562
commit 509bf830b1

View file

@ -94,7 +94,7 @@ type Vin struct {
Coinbase string `json:"coinbase,omitempty"` Coinbase string `json:"coinbase,omitempty"`
Txid string `json:"txid,omitempty"` Txid string `json:"txid,omitempty"`
Vout int `json:"vout,omitempty"` Vout int `json:"vout,omitempty"`
ScriptSig struct { ScriptSig *struct {
Asm string `json:"asm"` Asm string `json:"asm"`
Hex string `json:"hex"` Hex string `json:"hex"`
} `json:"scriptSig,omitempty"` } `json:"scriptSig,omitempty"`