mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 09:53:54 +01:00
f5ef4992e0
This commit adds Warning messages to lnwire, as introduced in bolts/950. It does not include reading/writing of warning messages, which will be covered in followup commits.
23 lines
700 B
Go
23 lines
700 B
Go
package lnwire
|
|
|
|
// A compile time check to ensure Warning implements the lnwire.Message
|
|
// interface.
|
|
var _ Message = (*Warning)(nil)
|
|
|
|
// Warning is used to express non-critical errors in the protocol, providing
|
|
// a "soft" way for nodes to communicate failures. Since it has the same
|
|
// structure as errors, warnings simply include an Error so that we can leverage
|
|
// their encode/decode functionality, and over write the MsgType function to
|
|
// differentiate them.
|
|
type Warning struct {
|
|
Error
|
|
}
|
|
|
|
// MsgType returns the integer uniquely identifying an Warning message on the
|
|
// wire.
|
|
//
|
|
// This is part of the lnwire.Message interface.
|
|
func (c *Warning) MsgType() MessageType {
|
|
return MsgWarning
|
|
}
|