funding: wait for one sec if funding locked is not received
This commit is contained in:
2 files changed
+13
-1
No files matched your search
+9
-1
@@ -1021,7 +1021,14 @@ func (f *Manager) stateStep(channel *channeldb.OpenChannel,
|
||||
|
||||
if !received {
|
||||
// We haven't received FundingLocked, so we'll continue
|
||||
// to the next iteration of the loop.
|
||||
// to the next iteration of the loop after sleeping for
|
||||
// one second.
|
||||
select {
|
||||
case <-time.After(1 * time.Second):
|
||||
case <-f.quit:
|
||||
return ErrFundingManagerShuttingDown
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -2952,6 +2959,7 @@ func (f *Manager) receivedFundingLocked(node *btcec.PublicKey,
|
||||
|
||||
// Avoid a tight loop if peer is offline.
|
||||
if _, err := f.waitForPeerOnline(node); err != nil {
|
||||
log.Errorf("Wait for peer online failed: %v", err)
|
||||
return false, err
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user