code: func determineMainChainBlocks(blocksMap map[chainhash.Hash]*blockChainContext, tip *chainhash.Hash) {
  	for nextHash := tip; *nextHash != zeroHash; nextHash = blocksMap[*nextHash].parent {
  		blocksMap[*nextHash].mainChain = true
  	}
  }
docs: // determineMainChainBlocks traverses the block graph down from the tip to
  // determine which block hashes that are part of the main chain. This function
  // modifies the mainChain field on the blocksMap entries.