code: func (w *worker) updateSnapshot() {
  	w.snapshotMu.Lock()
  	defer w.snapshotMu.Unlock()
  
  	var uncles []*types.Header
  	w.current.uncles.Each(func(item interface{}) bool {
  		hash, ok := item.(common.Hash)
  		if !ok {
  			return false
  		}
  		uncle, exist := w.localUncles[hash]
  		if !exist {
  			uncle, exist = w.remoteUncles[hash]
  		}
  		if !exist {
  			return false
  		}
  		uncles = append(uncles, uncle.Header())
  		return false
  	})
  
  	w.snapshotBlock = types.NewBlock(
  		w.current.header,
  		w.current.txs,
  		uncles,
  		w.current.receipts,
  	)
  
  	w.snapshotState = w.current.state.Copy()
  }
docs: // updateSnapshot updates pending snapshot block and state.
  // Note this function assumes the current variable is thread safe.