mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-27 14:11:04 +02:00
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:
@@ -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) {
|
||||
|
||||
|
Reference in New Issue
Block a user