2016-07-15 14:02:59 +03:00
|
|
|
// Copyright (c) 2016 Bitfury Group Limited
|
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file LICENSE or http://www.opensource.org/licenses/mit-license.php
|
|
|
|
|
|
|
|
package lnwire
|
2016-08-11 21:54:44 +03:00
|
|
|
|
2016-07-15 14:02:59 +03:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"io"
|
|
|
|
)
|
|
|
|
|
|
|
|
type NeighborRstMessage struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (msg *NeighborRstMessage) String() string {
|
2016-08-23 22:41:41 +03:00
|
|
|
return fmt.Sprintf("NeighborRstMessage{}")
|
2016-07-15 14:02:59 +03:00
|
|
|
}
|
|
|
|
|
2016-08-11 21:54:44 +03:00
|
|
|
func (msg *NeighborRstMessage) Command() uint32 {
|
2016-07-15 14:02:59 +03:00
|
|
|
return CmdNeighborRstMessage
|
|
|
|
}
|
|
|
|
|
2016-08-11 21:54:44 +03:00
|
|
|
func (msg *NeighborRstMessage) Encode(w io.Writer, pver uint32) error {
|
2016-10-05 23:47:02 +03:00
|
|
|
_, err := w.Write([]byte("NeighborRstMessage"))
|
|
|
|
return err
|
2016-07-15 14:02:59 +03:00
|
|
|
}
|
|
|
|
|
2016-08-11 21:54:44 +03:00
|
|
|
func (msg *NeighborRstMessage) Decode(r io.Reader, pver uint32) error {
|
2016-10-05 23:47:02 +03:00
|
|
|
// 18 is the length of "NeighborRstMessage"
|
|
|
|
var b [18]byte
|
|
|
|
_, err := r.Read(b[:])
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if string(b[:]) != "NeighborRstMessage" {
|
|
|
|
return fmt.Errorf("Incorrect content of NeighborRstMessage")
|
|
|
|
}
|
2016-07-15 14:02:59 +03:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2016-08-11 21:54:44 +03:00
|
|
|
func (msg *NeighborRstMessage) MaxPayloadLength(uint32) uint32 {
|
2016-10-05 23:47:02 +03:00
|
|
|
// 18 is the length of "NeighborRstMessage"
|
|
|
|
return 18
|
2016-07-15 14:02:59 +03:00
|
|
|
}
|
|
|
|
|
2016-08-11 21:54:44 +03:00
|
|
|
func (msg *NeighborRstMessage) Validate() error {
|
2016-07-15 14:02:59 +03:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2016-08-11 21:54:44 +03:00
|
|
|
var _ Message = (*NeighborRstMessage)(nil)
|