mirror of https://github.com/edouardparis/lntop
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1019 B
Go
46 lines
1019 B
Go
3 years ago
|
package models
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
RoutingSend = iota + 1
|
||
|
RoutingReceive
|
||
|
RoutingForward
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
RoutingStatusActive = iota + 1
|
||
|
RoutingStatusFailed
|
||
|
RoutingStatusSettled
|
||
|
RoutingStatusLinkFailed
|
||
|
)
|
||
|
|
||
|
type RoutingEvent struct {
|
||
|
IncomingChannelId uint64
|
||
|
OutgoingChannelId uint64
|
||
|
IncomingHtlcId uint64
|
||
|
OutgoingHtlcId uint64
|
||
|
LastUpdate time.Time
|
||
|
Direction int
|
||
|
Status int
|
||
|
IncomingTimelock uint32
|
||
|
OutgoingTimelock uint32
|
||
|
AmountMsat uint64
|
||
|
FeeMsat uint64
|
||
|
FailureCode int32
|
||
|
FailureDetail string
|
||
|
}
|
||
|
|
||
|
func (u *RoutingEvent) Equals(other *RoutingEvent) bool {
|
||
|
return u.IncomingChannelId == other.IncomingChannelId && u.IncomingHtlcId == other.IncomingHtlcId && u.OutgoingChannelId == other.OutgoingChannelId && u.OutgoingHtlcId == other.OutgoingHtlcId
|
||
|
}
|
||
|
|
||
|
func (u *RoutingEvent) Update(newer *RoutingEvent) {
|
||
|
u.LastUpdate = newer.LastUpdate
|
||
|
u.Status = newer.Status
|
||
|
u.FailureCode = newer.FailureCode
|
||
|
u.FailureDetail = newer.FailureDetail
|
||
|
}
|