multi: add AddPendingChannel to peer interface

The funding manager has been updated to use `AddPendingChannel`. Note
that we track the pending channel before it's confirmed as the peer may
have a block height in the future(from our view), thus they may start
operating in this channel before we consider it as fully open.

The mocked peers have been updated to implement the new interface method.
This commit is contained in:
yyforyongyu committed 2023-08-09 00:17:22 +08:00
1 parent f39c568c94
commit e46bd8e177
6 files changed
+46 -1

No files matched your search

+4
View File
@@ -27,6 +27,10 @@ type Peer interface {
// to be added if the cancel channel is closed.
AddNewChannel(channel *channeldb.OpenChannel, cancel <-chan struct{}) error
// AddPendingChannel adds a pending open channel ID to the peer. The
// channel should fail to be added if the cancel chan is closed.
AddPendingChannel(cid lnwire.ChannelID, cancel <-chan struct{}) error
// WipeChannel removes the channel uniquely identified by its channel
// point from all indexes associated with the peer.
WipeChannel(*wire.OutPoint)