multi: add zeroconfacceptor that default rejects if no rpc acceptors

This is a safety mechanism so that zero-conf channels are not accepted
by default if no rpc acceptor exists.
This commit is contained in:
eugene committed 2022-08-12 16:30:42 -04:00
1 parent a1cd7734d8
commit c2a4a9adbc
8 files changed
+224 -11

No files matched your search

+13
View File
@@ -118,3 +118,16 @@ func (c *ChannelAcceptResponse) RejectChannel() bool {
type ChannelAcceptor interface {
Accept(req *ChannelAcceptRequest) *ChannelAcceptResponse
}
// MultiplexAcceptor is an interface that abstracts the ability of a
// ChannelAcceptor to contain sub-ChannelAcceptors.
type MultiplexAcceptor interface {
// Embed the ChannelAcceptor.
ChannelAcceptor
// AddAcceptor nests a ChannelAcceptor inside the MultiplexAcceptor.
AddAcceptor(acceptor ChannelAcceptor) uint64
// Remove a sub-ChannelAcceptor.
RemoveAcceptor(id uint64)
}