Implement DeserializeOutputs

This commit is contained in:
Ivan Kuznetsov 2017-09-17 11:01:06 +07:00
parent cb78220abb
commit b15e1117f9
1 changed files with 13 additions and 0 deletions

View File

@ -49,3 +49,16 @@ func (outs TXOutputs) Serialize() []byte {
return buff.Bytes()
}
// DeserializeOutputs deserializes TXOutputs
func DeserializeOutputs(data []byte) TXOutputs {
var outputs TXOutputs
dec := gob.NewDecoder(bytes.NewReader(data))
err := dec.Decode(&outputs)
if err != nil {
log.Panic(err)
}
return outputs
}