kaspad/app/appmessage/p2p_msgreject.go
2023-08-23 15:36:21 +09:00

23 lines
583 B
Go

package appmessage
// MsgReject implements the Message interface and represents a c4ex
// Reject message. It is used to notify peers why they are banned.
type MsgReject struct {
baseMessage
Reason string
}
// Command returns the protocol command string for the message. This is part
// of the Message interface implementation.
func (msg *MsgReject) Command() MessageCommand {
return CmdReject
}
// NewMsgReject returns a new c4ex Reject message that conforms to the
// Message interface.
func NewMsgReject(reason string) *MsgReject {
return &MsgReject{
Reason: reason,
}
}