instantout: store active swaps under real hash

New instant outs were added to the active map before the swap hash existed.

The FSM was stored under the zero hash, making real-hash lookups fail.
This commit is contained in:
Slyghtning 2026-05-20 21:48:20 +02:00
parent add29cf2d0
commit fc884a4ef0

View file

@ -159,14 +159,12 @@ func (m *Manager) NewInstantOut(ctx context.Context,
protocolVersion: CurrentProtocolVersion(),
sweepAddress: sweepAddr,
}
m.Unlock()
instantOut, err := NewFSM(m.cfg, ProtocolVersionFullReservation)
if err != nil {
m.Unlock()
return nil, err
}
m.activeInstantOuts[instantOut.InstantOut.SwapHash] = instantOut
m.Unlock()
// Start the instantout FSM.
go func() {
@ -186,6 +184,10 @@ func (m *Manager) NewInstantOut(ctx context.Context,
return nil, err
}
m.Lock()
m.activeInstantOuts[instantOut.InstantOut.SwapHash] = instantOut
m.Unlock()
return instantOut, nil
}