2
0
mirror of https://github.com/edouardparis/lntop synced 2024-11-16 00:12:44 +00:00
lntop/network/models/channel.go

63 lines
1.6 KiB
Go
Raw Normal View History

2019-03-15 16:02:16 +00:00
package models
2019-04-03 12:11:49 +00:00
import (
"time"
"github.com/edouardparis/lntop/logging"
)
2019-03-15 16:02:16 +00:00
2019-03-29 11:38:09 +00:00
type ChannelsBalance struct {
2019-03-15 16:02:16 +00:00
Balance int64
PendingOpenBalance int64
}
2019-03-29 11:38:09 +00:00
func (m ChannelsBalance) MarshalLogObject(enc logging.ObjectEncoder) error {
2019-03-15 16:02:16 +00:00
enc.AddInt64("balance", m.Balance)
enc.AddInt64("pending_open_balance", m.PendingOpenBalance)
return nil
}
type Channel struct {
ID uint64
Active bool
RemotePubKey string
ChannelPoint string
Capacity int64
LocalBalance int64
RemoteBalance int64
CommitFee int64
CommitWeight int64
FeePerKiloWeight int64
UnsettledBalance int64
TotalAmountSent int64
TotalAmountReceived int64
UpdatesCount uint64
CSVDelay uint32
Private bool
PendingHTLC []*HTLC
2019-04-03 12:11:49 +00:00
LastUpdated *time.Time
2019-03-15 16:02:16 +00:00
}
func (m Channel) MarshalLogObject(enc logging.ObjectEncoder) error {
enc.AddUint64("id", m.ID)
enc.AddBool("active", m.Active)
enc.AddString("remote_pubkey", m.RemotePubKey)
enc.AddString("channel_point", m.ChannelPoint)
enc.AddInt64("capacity", m.Capacity)
enc.AddInt64("local_balance", m.LocalBalance)
enc.AddInt64("remote_balance", m.RemoteBalance)
enc.AddInt64("commit_fee", m.CommitFee)
enc.AddInt64("commit_weight", m.CommitWeight)
enc.AddInt64("unsettled_balance", m.UnsettledBalance)
enc.AddInt64("total_amount_sent", m.TotalAmountSent)
enc.AddInt64("total_amount_received", m.TotalAmountReceived)
enc.AddUint64("updates_count", m.UpdatesCount)
enc.AddBool("private", m.Private)
return nil
}
2019-03-27 12:32:23 +00:00
type ChannelUpdate struct {
}