mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-18 13:08:28 +02:00
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:
parent
add29cf2d0
commit
fc884a4ef0
1 changed files with 5 additions and 3 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue