Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions chanevents/chanevents.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ type EventType int16

const (
// EventTypeUnknown is the unknown event type.
EventTypeUnknown = 0
EventTypeUnknown EventType = 0

// EventTypeOnline is the online event type.
EventTypeOnline = 1
EventTypeOnline EventType = 1

// EventTypeOffline is the offline event type.
EventTypeOffline = 2
EventTypeOffline EventType = 2

// EventTypeUpdate is the balance update event type.
EventTypeUpdate = 3
EventTypeUpdate EventType = 3
)

// String returns the string representation of the event type.
Expand Down Expand Up @@ -106,4 +106,8 @@ type ChannelEvent struct {
// RemoteBalance is the remote balance of the channel at the time of the
// event. This is only populated for balance update events.
RemoteBalance fn.Option[btcutil.Amount]

// IsSync indicates whether this event was recorded during an initial
// sync rather than from a live subscription.
IsSync bool
}
25 changes: 25 additions & 0 deletions chanevents/log.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package chanevents

import (
"github.com/btcsuite/btclog/v2"
"github.com/lightningnetwork/lnd/build"
)

const Subsystem = "CHEV"

// log is a logger that is initialized with no output filters. This
// means the package will not perform any logging by default until the caller
// requests it.
var log btclog.Logger

// The default amount of logging is none.
func init() {
UseLogger(build.NewSubLogger(Subsystem, nil))
}

// UseLogger uses a specified Logger to output package logging info.
// This should be used in preference to SetLogWriter if the caller is also
// using btclog.
func UseLogger(logger btclog.Logger) {
log = logger
}
Loading
Loading