code: func (b *BlockChain) removeOrphanBlock(orphan *orphanBlock) {
  	// Protect concurrent access.
  	b.orphanLock.Lock()
  	defer b.orphanLock.Unlock()
  
  	// Remove the orphan block from the orphan pool.
  	orphanHash := orphan.block.Hash()
  	delete(b.orphans, *orphanHash)
  
  	// Remove the reference from the previous orphan index too.  An indexing
  	// for loop is intentionally used over a range here as range does not
  	// reevaluate the slice on each iteration nor does it adjust the index
  	// for the modified slice.
  	prevHash := &orphan.block.MsgBlock().Header.PrevBlock
  	orphans := b.prevOrphans[*prevHash]
  	for i := 0; i < len(orphans); i++ {
  		hash := orphans[i].block.Hash()
  		if hash.IsEqual(orphanHash) {
  			copy(orphans[i:], orphans[i+1:])
  			orphans[len(orphans)-1] = nil
  			orphans = orphans[:len(orphans)-1]
  			i--
  		}
  	}
  	b.prevOrphans[*prevHash] = orphans
  
  	// Remove the map entry altogether if there are no longer any orphans
  	// which depend on the parent hash.
  	if len(b.prevOrphans[*prevHash]) == 0 {
  		delete(b.prevOrphans, *prevHash)
  	}
  }
docs: // removeOrphanBlock removes the passed orphan block from the orphan pool and
  // previous orphan index.