diff --git a/server/swap/swap.go b/server/swap/swap.go index 06e0a35455..c9026429b8 100644 --- a/server/swap/swap.go +++ b/server/swap/swap.go @@ -1097,13 +1097,12 @@ func (s *Swapper) processBlock(ctx context.Context, block *blockNotification) { // If it's neither of the match assets, nothing to do. if match.makerStatus.swapAsset != block.assetID && match.takerStatus.swapAsset != block.assetID { - return + continue } // Lock the matchTracker so the following checks and updates are atomic // with respect to Status. match.mtx.RLock() - defer match.mtx.RUnlock() switch match.Status { case order.MakerSwapCast: @@ -1127,6 +1126,8 @@ func (s *Swapper) processBlock(ctx context.Context, block *blockNotification) { s.unlockOrderCoins(match.Taker) } } + + match.mtx.RUnlock() } }