2016-07-15 14:02:59 +03:00
|
|
|
// 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 (
|
|
|
|
"github.com/BitfuryLightning/tools/rt/graph"
|
|
|
|
)
|
|
|
|
|
2016-08-11 21:54:44 +03:00
|
|
|
// RoutingMessageBase is the base struct for all routing messages within the
|
|
|
|
// lnwire package.
|
2016-07-15 14:02:59 +03:00
|
|
|
type RoutingMessageBase struct {
|
2016-08-11 21:54:44 +03:00
|
|
|
// SenderID is the ID of the sender of the routing message.
|
2016-07-15 14:02:59 +03:00
|
|
|
SenderID graph.ID
|
2016-08-11 21:54:44 +03:00
|
|
|
|
|
|
|
// ReceiverID is the ID of the receiver of the routig message.
|
2016-07-15 14:02:59 +03:00
|
|
|
ReceiverID graph.ID
|
|
|
|
}
|
|
|
|
|
2016-08-11 21:54:44 +03:00
|
|
|
// GetReceiverID returns the ID of the receiver of routing message.
|
|
|
|
func (msg RoutingMessageBase) GetReceiverID() graph.ID {
|
2016-07-15 14:02:59 +03:00
|
|
|
return msg.ReceiverID
|
|
|
|
}
|
|
|
|
|
2016-08-11 21:54:44 +03:00
|
|
|
// GetSenderID returns the ID of the sender of the routing message.
|
|
|
|
func (msg RoutingMessageBase) GetSenderID() graph.ID {
|
2016-07-15 14:02:59 +03:00
|
|
|
return msg.SenderID
|
|
|
|
}
|
|
|
|
|
2016-08-11 21:54:44 +03:00
|
|
|
// RoutingMessageBase is a shared interface for all routing messages.
|
2016-07-15 14:02:59 +03:00
|
|
|
type RoutingMessage interface {
|
|
|
|
GetSenderID() graph.ID
|
|
|
|
GetReceiverID() graph.ID
|
|
|
|
}
|