File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -2020,19 +2020,22 @@ func (f *Manager) funderProcessAcceptChannel(peer lnpeer.Peer,
20202020 return
20212021 }
20222022
2023- // Fail early if minimum depth is set to 0 and the channel is not
2024- // zero-conf.
2025- if ! resCtx .reservation .IsZeroConf () && msg .MinAcceptDepth == 0 {
2026- err = fmt .Errorf ("non-zero-conf channel has min depth zero" )
2027- log .Warn (err )
2028- f .failFundingFlow (peer , cid , err )
2029- return
2023+ // If this is not a zero-conf channel but the peer responded with a
2024+ // min-depth of zero, we will use our minimum of 1 instead.
2025+ minDepth := msg .MinAcceptDepth
2026+ if ! resCtx .reservation .IsZeroConf () && minDepth == 0 {
2027+ log .Infof ("Responder to pending_id=%v sent a minimum " +
2028+ "confirmation depth of 0 for non-zero-conf channel. " +
2029+ "We will use a minimum depth of 1 instead." ,
2030+ cid .tempChanID )
2031+
2032+ minDepth = 1
20302033 }
20312034
20322035 // We'll also specify the responder's preference for the number of
20332036 // required confirmations, and also the set of channel constraints
20342037 // they've specified for commitment states we can create.
2035- resCtx .reservation .SetNumConfsRequired (uint16 (msg . MinAcceptDepth ))
2038+ resCtx .reservation .SetNumConfsRequired (uint16 (minDepth ))
20362039 channelConstraints := & channeldb.ChannelConstraints {
20372040 DustLimit : msg .DustLimit ,
20382041 ChanReserve : msg .ChannelReserve ,
You can’t perform that action at this time.
0 commit comments