multi: rename ChannelAnnouncement to ChannelAnnouncment1
In preparation for adding the new ChannelAnnouncement2 message along with a ChannelAnnouncement interface, we rename the existing message to ChannelAnnouncement1.
This commit is contained in:
17 files changed
+55
-54
No files matched your search
@@ -7,10 +7,10 @@ import (
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
)
|
||||
|
||||
// ChannelAnnouncement message is used to announce the existence of a channel
|
||||
// ChannelAnnouncement1 message is used to announce the existence of a channel
|
||||
// between two peers in the overlay, which is propagated by the discovery
|
||||
// service over broadcast handler.
|
||||
type ChannelAnnouncement struct {
|
||||
type ChannelAnnouncement1 struct {
|
||||
// This signatures are used by nodes in order to create cross
|
||||
// references between node's channel and node. Requiring both nodes
|
||||
// to sign indicates they are both willing to route other payments via
|
||||
@@ -60,13 +60,13 @@ type ChannelAnnouncement struct {
|
||||
|
||||
// A compile time check to ensure ChannelAnnouncement implements the
|
||||
// lnwire.Message interface.
|
||||
var _ Message = (*ChannelAnnouncement)(nil)
|
||||
var _ Message = (*ChannelAnnouncement1)(nil)
|
||||
|
||||
// Decode deserializes a serialized ChannelAnnouncement stored in the passed
|
||||
// io.Reader observing the specified protocol version.
|
||||
//
|
||||
// This is part of the lnwire.Message interface.
|
||||
func (a *ChannelAnnouncement) Decode(r io.Reader, pver uint32) error {
|
||||
func (a *ChannelAnnouncement1) Decode(r io.Reader, pver uint32) error {
|
||||
return ReadElements(r,
|
||||
&a.NodeSig1,
|
||||
&a.NodeSig2,
|
||||
@@ -87,7 +87,7 @@ func (a *ChannelAnnouncement) Decode(r io.Reader, pver uint32) error {
|
||||
// observing the protocol version specified.
|
||||
//
|
||||
// This is part of the lnwire.Message interface.
|
||||
func (a *ChannelAnnouncement) Encode(w *bytes.Buffer, pver uint32) error {
|
||||
func (a *ChannelAnnouncement1) Encode(w *bytes.Buffer, pver uint32) error {
|
||||
if err := WriteSig(w, a.NodeSig1); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -139,13 +139,13 @@ func (a *ChannelAnnouncement) Encode(w *bytes.Buffer, pver uint32) error {
|
||||
// wire.
|
||||
//
|
||||
// This is part of the lnwire.Message interface.
|
||||
func (a *ChannelAnnouncement) MsgType() MessageType {
|
||||
func (a *ChannelAnnouncement1) MsgType() MessageType {
|
||||
return MsgChannelAnnouncement
|
||||
}
|
||||
|
||||
// DataToSign is used to retrieve part of the announcement message which should
|
||||
// be signed.
|
||||
func (a *ChannelAnnouncement) DataToSign() ([]byte, error) {
|
||||
func (a *ChannelAnnouncement1) DataToSign() ([]byte, error) {
|
||||
// We should not include the signatures itself.
|
||||
b := make([]byte, 0, MaxMsgBody)
|
||||
buf := bytes.NewBuffer(b)
|
||||
|
||||
Reference in new issue
Block a user