func (s *server) GetBlock(ctx context.Context, in *pb.GetBlockRequest) (*pb.GetBlockResponse, error) {
	h, err := chainhash.NewHash(in.Hash)
	if err != nil {
		return nil, err
	}
	block, err := s.chain.GetBlockByHash(*h)
	if err != nil {
		return nil, err
	}

	return &pb.GetBlockResponse{
		Block: block.ToProto(),
	}, nil
}
// GetBlock gets a block by hash.
GetBlock gets a block by hash.
// GetBlock gets a block by hash .
func (s *server) GetBlock(ctx context.Context, in *pb.GetBlockRequest) (*pb.GetBlockResponse, error) {
	h, err := chainhash.NewHash(in.Hash)
	if err != nil {
		return nil, err
	}
	block, err := s.chain.GetBlockByHash(*h)
	if err != nil {
		return nil, err
	}
	return &pb.GetBlockResponse{
		Block: block.ToProto(),
	}, nil
}
func ( s * server ) GetBlock ( ctx context . Context , in * pb . GetBlockRequest ) ( * pb . GetBlockResponse , error ) { h , err := chainhash . NewHash ( in . Hash ) if err != nil { return nil , err } block , err := s . chain . GetBlockByHash ( * h ) if err != nil { return nil , err } return & pb . GetBlockResponse { Block : block . ToProto ( ) , } , nil }
GetBlock gets a block by hash.
GetBlock gets a block by hash .