code: func (b *BlockChain) GetOrphanRoot(hash *chainhash.Hash) *chainhash.Hash {
  	// Protect concurrent access.  Using a read lock only so multiple
  	// readers can query without blocking each other.
  	b.orphanLock.RLock()
  	defer b.orphanLock.RUnlock()
  
  	// Keep looping while the parent of each orphaned block is
  	// known and is an orphan itself.
  	orphanRoot := hash
  	prevHash := hash
  	for {
  		orphan, exists := b.orphans[*prevHash]
  		if !exists {
  			break
  		}
  		orphanRoot = prevHash
  		prevHash = &orphan.block.MsgBlock().Header.PrevBlock
  	}
  
  	return orphanRoot
  }
docs: // GetOrphanRoot returns the head of the chain for the provided hash from the
  // map of orphan blocks.
  //
  // This function is safe for concurrent access.