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
2022-07-08 17:18:14 -04:00
parent a1cd7734d8
commit c2a4a9adbc
8 changed files with 224 additions and 11 deletions

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)
}