lnd: Remove some sleeps in integration tests.
There is a sleep after channels are opened to ensure the channel is removed from the set of pending reservations. We can avoid this sleep and get better guarantees of the channel being opened by deleting the reservation just before updating channel state to active instead of after.
This commit is contained in:
1 parent
c501da3a95
commit
78f8ddef72
2 files changed
+7
-14
No files matched your search
+4
-4
@@ -1167,6 +1167,8 @@ func (f *fundingManager) handleFundingCreated(fmsg *fundingCreatedMsg) {
|
||||
return
|
||||
}
|
||||
|
||||
f.deleteReservationCtx(peerKey, fmsg.msg.PendingChannelID)
|
||||
|
||||
// Success, funding transaction was confirmed.
|
||||
err := f.handleFundingConfirmation(completeChan,
|
||||
shortChanID)
|
||||
@@ -1175,8 +1177,6 @@ func (f *fundingManager) handleFundingCreated(fmsg *fundingCreatedMsg) {
|
||||
"confirmation: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
f.deleteReservationCtx(peerKey, fmsg.msg.PendingChannelID)
|
||||
}
|
||||
}()
|
||||
}
|
||||
@@ -1291,6 +1291,8 @@ func (f *fundingManager) handleFundingSigned(fmsg *fundingSignedMsg) {
|
||||
return
|
||||
}
|
||||
|
||||
f.deleteReservationCtx(peerKey, pendingChanID)
|
||||
|
||||
// Success, funding transaction was confirmed
|
||||
err := f.handleFundingConfirmation(completeChan,
|
||||
shortChanID)
|
||||
@@ -1314,8 +1316,6 @@ func (f *fundingManager) handleFundingSigned(fmsg *fundingSignedMsg) {
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
f.deleteReservationCtx(peerKey, pendingChanID)
|
||||
}()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user