mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-13 11:09:23 +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
15f17633aa
commit
4cfc92f420
1 changed files with 19 additions and 0 deletions
|
@ -80,6 +80,14 @@ type FullyResolvedChannelEvent struct {
|
||||||
ChannelPoint *wire.OutPoint
|
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
|
// New creates a new channel notifier. The ChannelNotifier gets channel
|
||||||
// events from peers and from the chain arbitrator, and dispatches them to
|
// events from peers and from the chain arbitrator, and dispatches them to
|
||||||
// its clients.
|
// its clients.
|
||||||
|
@ -184,6 +192,17 @@ 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 for "+
|
||||||
|
"ChanPoint(%v)", err, chanPoint)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// NotifyActiveLinkEvent notifies the channelEventNotifier goroutine that a
|
// NotifyActiveLinkEvent notifies the channelEventNotifier goroutine that a
|
||||||
// link has been added to the switch.
|
// link has been added to the switch.
|
||||||
func (c *ChannelNotifier) NotifyActiveLinkEvent(chanPoint wire.OutPoint) {
|
func (c *ChannelNotifier) NotifyActiveLinkEvent(chanPoint wire.OutPoint) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue