code: func (bi *blockImporter) processBlock(serializedBlock []byte) (bool, error) {
  	// Deserialize the block which includes checks for malformed blocks.
  	block, err := btcutil.NewBlockFromBytes(serializedBlock)
  	if err != nil {
  		return false, err
  	}
  
  	// update progress statistics
  	bi.lastBlockTime = block.MsgBlock().Header.Timestamp
  	bi.receivedLogTx += int64(len(block.MsgBlock().Transactions))
  
  	// Skip blocks that already exist.
  	var exists bool
  	err = bi.db.View(func(tx database.Tx) error {
  		exists, err = tx.HasBlock(block.Hash())
  		return err
  	})
  	if err != nil {
  		return false, err
  	}
  	if exists {
  		return false, nil
  	}
  
  	// Don't bother trying to process orphans.
  	prevHash := &block.MsgBlock().Header.PrevBlock
  	if !prevHash.IsEqual(&zeroHash) {
  		var exists bool
  		err := bi.db.View(func(tx database.Tx) error {
  			exists, err = tx.HasBlock(prevHash)
  			return err
  		})
  		if err != nil {
  			return false, err
  		}
  		if !exists {
  			return false, fmt.Errorf("import file contains block "+
  				"%v which does not link to the available "+
  				"block chain", prevHash)
  		}
  	}
  
  	// Put the blocks into the database with no checking of chain rules.
  	err = bi.db.Update(func(tx database.Tx) error {
  		return tx.StoreBlock(block)
  	})
  	if err != nil {
  		return false, err
  	}
  
  	return true, nil
  }
docs: // processBlock potentially imports the block into the database.  It first
  // deserializes the raw block while checking for errors.  Already known blocks
  // are skipped and orphan blocks are considered errors.  Returns whether the
  // block was imported along with any potential errors.
  //
  // NOTE: This is not a safe import as it does not verify chain rules.