lnwire: remove old routing/discovery messages
This commit removes the older routing/discovery messages from the unwire package, as we’ll be converging towards BOLT07 in the near-term. In the mid to far term we’ll be revisiting integrating Flare into the newer scheme in order to take advantage of its scaling characteristics.
This commit is contained in:
10 files changed
+2
-539
No files matched your search
@@ -65,14 +65,6 @@ func (c CreditsAmount) ToSatoshi() int64 {
|
||||
return int64(c / 1000)
|
||||
}
|
||||
|
||||
type ChannelOperation struct {
|
||||
NodePubKey1, NodePubKey2 [33]byte
|
||||
ChannelId *wire.OutPoint
|
||||
Capacity int64
|
||||
Weight float64
|
||||
Operation byte
|
||||
}
|
||||
|
||||
// writeElement is a one-stop shop to write the big endian representation of
|
||||
// any element which is to be serialized for the wire protocol. The passed
|
||||
// io.Writer should be backed by an appropriatly sized byte slice, or be able
|
||||
@@ -304,29 +296,6 @@ func writeElement(w io.Writer, element interface{}) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
case []ChannelOperation:
|
||||
err := writeElement(w, uint64(len(e)))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for i := 0; i < len(e); i++ {
|
||||
err := writeElement(w, e[i])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
case ChannelOperation:
|
||||
err := writeElements(w,
|
||||
e.NodePubKey1,
|
||||
e.NodePubKey2,
|
||||
e.ChannelId,
|
||||
e.Capacity,
|
||||
e.Weight,
|
||||
e.Operation,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
case ChannelID:
|
||||
// Check that field fit in 3 bytes and write the blockHeight
|
||||
if e.BlockHeight > ((1 << 24) - 1) {
|
||||
@@ -645,31 +614,6 @@ func readElement(r io.Reader, element interface{}) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
case *[]ChannelOperation:
|
||||
var nChannels uint64
|
||||
err := readElement(r, &nChannels)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*e = make([]ChannelOperation, nChannels)
|
||||
for i := uint64(0); i < nChannels; i++ {
|
||||
err := readElement(r, &((*e)[i]))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
case *ChannelOperation:
|
||||
err := readElements(r,
|
||||
&e.NodePubKey1,
|
||||
&e.NodePubKey2,
|
||||
&e.ChannelId,
|
||||
&e.Capacity,
|
||||
&e.Weight,
|
||||
&e.Operation,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
case *ChannelID:
|
||||
var blockHeight [4]byte
|
||||
if _, err = io.ReadFull(r, blockHeight[1:]); err != nil {
|
||||
|
||||
Reference in new issue
Block a user