File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 11module github.com/lightninglabs/loop/looprpc
22
3- go 1.22.3
3+ go 1.23.0
4+
45toolchain go1.23.7
56
67require (
Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ func (m *Manager) Run(ctx context.Context) error {
131131 select {
132132 case height := <- newBlockChan :
133133 // Inform all active deposits about a new block arrival.
134+ m .mu .Lock ()
134135 for _ , fsm := range m .activeDeposits {
135136 select {
136137 case fsm .blockNtfnChan <- uint32 (height ):
@@ -139,11 +140,14 @@ func (m *Manager) Run(ctx context.Context) error {
139140 return ctx .Err ()
140141 }
141142 }
143+ m .mu .Unlock ()
142144 case outpoint := <- m .finalizedDepositChan :
143145 // If deposits notify us about their finalization, we
144146 // update the manager's internal state and flush the
145147 // finalized deposit from memory.
148+ m .mu .Lock ()
146149 delete (m .activeDeposits , outpoint )
150+ m .mu .Unlock ()
147151
148152 case err = <- newBlockErrChan :
149153 return err
@@ -192,7 +196,9 @@ func (m *Manager) recoverDeposits(ctx context.Context) error {
192196 }
193197 }()
194198
199+ m .mu .Lock ()
195200 m .activeDeposits [d .OutPoint ] = fsm
201+ m .mu .Unlock ()
196202 }
197203
198204 return nil
You can’t perform that action at this time.
0 commit comments