mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 18:10:34 +01:00
327768f4ad
Use [33]byte for graph vertex representation. Delete unneeded stuff: 1. DeepEqual for graph comparison 2. EdgePath 3. 2-thread BFS 4. Table transfer messages and neighborhood radius 5. Beacons Refactor: 1. Change ID to Vertex 2. Test use table driven approach 3. Add comments 4. Make graph internal representation private 5. Use wire.OutPoint as EdgeId 6. Decouple routing messages from routing implementation 7. Delete Async methods 8. Delete unneeded channels and priority buffer from manager 9. Delete unneeded interfaces in internal graph realisation 10. Renamed ID to Vertex
46 lines
1.0 KiB
Go
46 lines
1.0 KiB
Go
// 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
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
)
|
|
|
|
type NeighborHelloMessage struct {
|
|
// List of channels
|
|
Channels []ChannelOperation
|
|
}
|
|
|
|
func (msg *NeighborHelloMessage) Decode(r io.Reader, pver uint32) error {
|
|
err := readElements(r, &msg.Channels)
|
|
return err
|
|
}
|
|
|
|
func (msg *NeighborHelloMessage) Encode(w io.Writer, pver uint32) error {
|
|
err := writeElement(w, msg.Channels)
|
|
return err
|
|
}
|
|
|
|
func (msg *NeighborHelloMessage) Command() uint32 {
|
|
return CmdNeighborHelloMessage
|
|
}
|
|
|
|
func (msg *NeighborHelloMessage) MaxPayloadLength(uint32) uint32 {
|
|
// TODO: Insert some estimations
|
|
return 1000000
|
|
}
|
|
|
|
func (msg *NeighborHelloMessage) Validate() error {
|
|
// TODO: Add validation
|
|
return nil
|
|
}
|
|
|
|
func (msg *NeighborHelloMessage) String() string {
|
|
return fmt.Sprintf("NeighborHelloMessage{%v}", msg.Channels)
|
|
}
|
|
|
|
var _ Message = (*NeighborHelloMessage)(nil)
|