code: func (sm *SyncManager) handleStallSample() {
  	if atomic.LoadInt32(&sm.shutdown) != 0 {
  		return
  	}
  
  	// If we don't have an active sync peer, exit early.
  	if sm.syncPeer == nil {
  		return
  	}
  
  	// If the stall timeout has not elapsed, exit early.
  	if time.Since(sm.lastProgressTime) <= maxStallDuration {
  		return
  	}
  
  	// Check to see that the peer's sync state exists.
  	state, exists := sm.peerStates[sm.syncPeer]
  	if !exists {
  		return
  	}
  
  	sm.clearRequestedState(state)
  
  	disconnectSyncPeer := sm.shouldDCStalledSyncPeer()
  	sm.updateSyncPeer(disconnectSyncPeer)
  }
docs: // handleStallSample will switch to a new sync peer if the current one has
  // stalled. This is detected when by comparing the last progress timestamp with
  // the current time, and disconnecting the peer if we stalled before reaching
  // their highest advertised block.