lnwire: add serializing and deserializing for type [6]byte
and remove serialization for type [4]byte.
This commit is contained in:
parent
97aa478ce1
commit
46d23919e7
@ -171,6 +171,10 @@ func writeElement(w io.Writer, element interface{}) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := w.Write(e[:]); err != nil {
|
||||
return err
|
||||
}
|
||||
case [6]byte:
|
||||
if _, err := w.Write(e[:]); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -467,6 +471,10 @@ func readElement(r io.Reader, element interface{}) error {
|
||||
if _, err := io.ReadFull(r, *e); err != nil {
|
||||
return err
|
||||
}
|
||||
case *[6]byte:
|
||||
if _, err := io.ReadFull(r, e[:]); err != nil {
|
||||
return err
|
||||
}
|
||||
case []byte:
|
||||
if _, err := io.ReadFull(r, e); err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user