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

+12
View File
@@ -1369,6 +1369,18 @@ func (f *Manager) handleFundingOpen(peer lnpeer.Peer,
zeroConf = featureVec.IsSet(lnwire.ZeroConfRequired)
scid = featureVec.IsSet(lnwire.ScidAliasRequired)
// If the zero-conf channel type was negotiated, ensure that
// the acceptor allows it.
if zeroConf && !acceptorResp.ZeroConf {
// Fail the funding flow.
flowErr := fmt.Errorf("channel acceptor blocked " +
"zero-conf channel negotiation")
f.failFundingFlow(
peer, msg.PendingChannelID, flowErr,
)
return
}
// If the zero-conf channel type wasn't negotiated and the
// fundee still wants a zero-conf channel, perform more checks.
// Require that both sides have the scid-alias feature bit set.