funding+server.go: modify notifications to pass through server

This modifies the various channelnotifier notification functions
to instead hit the server and then call the notification routine.
This allows us to accurately modify the server's maps.
This commit is contained in:
Eugene Siegel committed 2025-03-11 20:42:35 -04:00
1 parent 6eb746fbba
commit 68ec766b61
3 files changed
+62 -10

No files matched your search

+16 -2
View File
@@ -231,17 +231,30 @@ type mockChanEvent struct {
pendingOpenEvent chan channelnotifier.PendingOpenChannelEvent
}
func (m *mockChanEvent) NotifyOpenChannelEvent(outpoint wire.OutPoint) {
func (m *mockChanEvent) NotifyOpenChannelEvent(outpoint wire.OutPoint,
remotePub *btcec.PublicKey) error {
m.openEvent <- outpoint
return nil
}
func (m *mockChanEvent) NotifyPendingOpenChannelEvent(outpoint wire.OutPoint,
pendingChannel *channeldb.OpenChannel) {
pendingChannel *channeldb.OpenChannel,
remotePub *btcec.PublicKey) error {
m.pendingOpenEvent <- channelnotifier.PendingOpenChannelEvent{
ChannelPoint: &outpoint,
PendingChannel: pendingChannel,
}
return nil
}
func (m *mockChanEvent) NotifyFundingTimeout(outpoint wire.OutPoint,
remotePub *btcec.PublicKey) error {
return nil
}
// mockZeroConfAcceptor always accepts the channel open request for zero-conf
@@ -550,6 +563,7 @@ func createTestFundingManager(t *testing.T, privKey *btcec.PrivateKey,
NotifyOpenChannelEvent: evt.NotifyOpenChannelEvent,
OpenChannelPredicate: chainedAcceptor,
NotifyPendingOpenChannelEvent: evt.NotifyPendingOpenChannelEvent,
NotifyFundingTimeout: evt.NotifyFundingTimeout,
DeleteAliasEdge: func(scid lnwire.ShortChannelID) (
*models.ChannelEdgePolicy, error) {