mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 01:36:24 +01:00
channelnotifier: add FundingTimeout and NotifyFundingTimeout
This signal will be used in the server.go code to potentially demote temporary-access peers to restricted-access peers.
This commit is contained in:
parent
2d705d16a1
commit
ca86eacf4f
1 changed files with 18 additions and 0 deletions
|
@ -80,6 +80,14 @@ type FullyResolvedChannelEvent struct {
|
|||
ChannelPoint *wire.OutPoint
|
||||
}
|
||||
|
||||
// FundingTimeoutEvent represents a new event where a pending-open channel has
|
||||
// timed out from the PoV of the funding manager because the funding tx
|
||||
// has not confirmed in the allotted time.
|
||||
type FundingTimeoutEvent struct {
|
||||
// ChannelPoint is the channelpoint for the newly inactive channel.
|
||||
ChannelPoint *wire.OutPoint
|
||||
}
|
||||
|
||||
// New creates a new channel notifier. The ChannelNotifier gets channel
|
||||
// events from peers and from the chain arbitrator, and dispatches them to
|
||||
// its clients.
|
||||
|
@ -184,6 +192,16 @@ func (c *ChannelNotifier) NotifyFullyResolvedChannelEvent(
|
|||
}
|
||||
}
|
||||
|
||||
// NotifyFundingTimeoutEvent notifies the channelEventNotifier goroutine that
|
||||
// a funding timeout has occurred for a certain channel point.
|
||||
func (c *ChannelNotifier) NotifyFundingTimeout(chanPoint wire.OutPoint) {
|
||||
// Send this event to all channel event subscribers.
|
||||
event := FundingTimeoutEvent{ChannelPoint: &chanPoint}
|
||||
if err := c.ntfnServer.SendUpdate(event); err != nil {
|
||||
log.Warnf("Unable to send funding timeout update: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// NotifyActiveLinkEvent notifies the channelEventNotifier goroutine that a
|
||||
// link has been added to the switch.
|
||||
func (c *ChannelNotifier) NotifyActiveLinkEvent(chanPoint wire.OutPoint) {
|
||||
|
|
Loading…
Add table
Reference in a new issue