diff --git a/fundingmanager.go b/fundingmanager.go index 6d46db4c..36450f3e 100644 --- a/fundingmanager.go +++ b/fundingmanager.go @@ -571,6 +571,14 @@ func (f *fundingManager) start() error { fndgLog.Debugf("ChannelID(%v) is now fully confirmed! "+ "(shortChanID=%v)", chanID, shortChanID) + err = f.handleFundingConfirmation(ch, *shortChanID) + if err != nil { + fndgLog.Errorf("unable to handle funding "+ + "confirmation for ChannelPoint(%v): %v", + ch.FundingOutpoint, err) + return + } + f.wg.Add(1) go f.advanceFundingState(ch, nil) }(channel) @@ -1635,6 +1643,14 @@ func (f *fundingManager) handleFundingCreated(fmsg *fundingCreatedMsg) { fndgLog.Debugf("ChannelID(%v) is now fully confirmed! "+ "(shortChanID=%v)", channelID, shortChanID) + err = f.handleFundingConfirmation(completeChan, *shortChanID) + if err != nil { + fndgLog.Errorf("unable to handle funding "+ + "confirmation for ChannelPoint(%v): %v", + completeChan.FundingOutpoint, err) + return + } + f.wg.Add(1) go f.advanceFundingState(completeChan, nil) @@ -1881,16 +1897,6 @@ func (f *fundingManager) waitForFundingWithTimeout(completeChan *channeldb.OpenC return } - err = f.handleFundingConfirmation( - completeChan, *shortChanID, - ) - if err != nil { - fndgLog.Errorf("unable to handle funding "+ - "confirmation for ChannelPoint(%v): %v", - completeChan.FundingOutpoint, err) - return - } - select { case confChan <- shortChanID: case <-f.quit: