mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
reservation: isolate asynchronous initialization errors
Use a goroutine-local result for event dispatch so observer errors remain independent and initialization outcomes stay deterministic.
This commit is contained in:
parent
806c1f9356
commit
2989ceee42
1 changed files with 5 additions and 3 deletions
|
|
@ -131,9 +131,11 @@ func (m *Manager) newReservation(ctx context.Context, currentHeight uint32,
|
||||||
|
|
||||||
// Send the init event to the state machine.
|
// Send the init event to the state machine.
|
||||||
go func() {
|
go func() {
|
||||||
err = reservationFSM.SendEvent(ctx, OnServerRequest, initContext)
|
sendErr := reservationFSM.SendEvent(
|
||||||
if err != nil {
|
ctx, OnServerRequest, initContext,
|
||||||
log.Errorf("Error sending init event: %v", err)
|
)
|
||||||
|
if sendErr != nil {
|
||||||
|
log.Errorf("Error sending init event: %v", sendErr)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue