code: func (msg *MsgMerkleBlock) BtcEncode(w io.Writer, pver uint32, enc MessageEncoding) error {
  	if pver < BIP0037Version {
  		str := fmt.Sprintf("merkleblock message invalid for protocol "+
  			"version %d", pver)
  		return messageError("MsgMerkleBlock.BtcEncode", str)
  	}
  
  	// Read num transaction hashes and limit to max.
  	numHashes := len(msg.Hashes)
  	if numHashes > maxTxPerBlock {
  		str := fmt.Sprintf("too many transaction hashes for message "+
  			"[count %v, max %v]", numHashes, maxTxPerBlock)
  		return messageError("MsgMerkleBlock.BtcDecode", str)
  	}
  	numFlagBytes := len(msg.Flags)
  	if numFlagBytes > maxFlagsPerMerkleBlock {
  		str := fmt.Sprintf("too many flag bytes for message [count %v, "+
  			"max %v]", numFlagBytes, maxFlagsPerMerkleBlock)
  		return messageError("MsgMerkleBlock.BtcDecode", str)
  	}
  
  	err := writeBlockHeader(w, pver, &msg.Header)
  	if err != nil {
  		return err
  	}
  
  	err = writeElement(w, msg.Transactions)
  	if err != nil {
  		return err
  	}
  
  	err = WriteVarInt(w, pver, uint64(numHashes))
  	if err != nil {
  		return err
  	}
  	for _, hash := range msg.Hashes {
  		err = writeElement(w, hash)
  		if err != nil {
  			return err
  		}
  	}
  
  	return WriteVarBytes(w, pver, msg.Flags)
  }
docs: // BtcEncode encodes the receiver to w using the bitcoin protocol encoding.
  // This is part of the Message interface implementation.