Skip to content

Commit

Permalink
funding: ignore maxWaitNumBlocksFundingConf for zero conf channels
Browse files Browse the repository at this point in the history
This is so that if the funding transaction hasn't been confirmed
in 2016 blocks, the channel isn't marked as closed by the responder.
  • Loading branch information
Crypt-iQ authored and Roasbeef committed Oct 13, 2022
1 parent 004e2a1 commit 69b7d96
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions funding/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -2457,7 +2457,7 @@ func (f *Manager) waitForFundingWithTimeout(
// If we are not the initiator, we have no money at stake and will
// timeout waiting for the funding transaction to confirm after a
// while.
if !ch.IsInitiator {
if !ch.IsInitiator && !ch.IsZeroConf() {
f.wg.Add(1)
go f.waitForTimeout(ch, cancelChan, timeoutChan)
}
Expand Down Expand Up @@ -3200,9 +3200,7 @@ func (f *Manager) waitForZeroConfChannel(c *channeldb.OpenChannel,
// is already confirmed, the chainntnfs subsystem will return with the
// confirmed tx. Otherwise, we'll wait here until confirmation occurs.
confChan, err := f.waitForFundingWithTimeout(c)
if err == ErrConfirmationTimeout {
return f.fundingTimeout(c, pendingID)
} else if err != nil {
if err != nil {
return fmt.Errorf("error waiting for zero-conf funding "+
"confirmation for ChannelPoint(%v): %v",
c.FundingOutpoint, err)
Expand Down

0 comments on commit 69b7d96

Please sign in to comment.