func (s *server) GetMempool(ctx context.Context, req *pb.MempoolRequest) (*pb.BlockBody, error) {
	lastBlockHash, err := chainhash.NewHash(req.LastBlockHash)
	if err != nil {
		return nil, err
	}

	lastBlockNode := s.chain.View.Index.GetBlockNodeByHash(*lastBlockHash)
	if lastBlockNode == nil {
		return nil, fmt.Errorf("could not find block with hash %s", lastBlockHash)
	}

	atts, err := s.mempool.GetAttestationsToInclude(lastBlockNode.Slot, *lastBlockHash, s.chain.GetConfig())
	if err != nil {
		return nil, err
	}

	bb := primitives.BlockBody{
		Attestations:      atts,
		ProposerSlashings: make([]primitives.ProposerSlashing, 0),
		CasperSlashings:   make([]primitives.CasperSlashing, 0),
		Deposits:          make([]primitives.Deposit, 0),
		Exits:             make([]primitives.Exit, 0),
	}

	return bb.ToProto(), nil
}
// GetMempool gets the mempool for a block.
GetMempool gets the mempool for a block.
// GetMempool gets the mempool for a block .
func (s *server) GetMempool(ctx context.Context, req *pb.MempoolRequest) (*pb.BlockBody, error) {
	lastBlockHash, err := chainhash.NewHash(req.LastBlockHash)
	if err != nil {
		return nil, err
	}
	lastBlockNode := s.chain.View.Index.GetBlockNodeByHash(*lastBlockHash)
	if lastBlockNode == nil {
		return nil, fmt.Errorf("could not find block with hash %s", lastBlockHash)
	}
	atts, err := s.mempool.GetAttestationsToInclude(lastBlockNode.Slot, *lastBlockHash, s.chain.GetConfig())
	if err != nil {
		return nil, err
	}
	bb := primitives.BlockBody{
		Attestations:      atts,
		ProposerSlashings: make([]primitives.ProposerSlashing, 0),
		CasperSlashings:   make([]primitives.CasperSlashing, 0),
		Deposits:          make([]primitives.Deposit, 0),
		Exits:             make([]primitives.Exit, 0),
	}
	return bb.ToProto(), nil
}
func ( s * server ) GetMempool ( ctx context . Context , req * pb . MempoolRequest ) ( * pb . BlockBody , error ) { lastBlockHash , err := chainhash . NewHash ( req . LastBlockHash ) if err != nil { return nil , err } lastBlockNode := s . chain . View . Index . GetBlockNodeByHash ( * lastBlockHash ) if lastBlockNode == nil { return nil , fmt . Errorf ( " " , lastBlockHash ) } atts , err := s . mempool . GetAttestationsToInclude ( lastBlockNode . Slot , * lastBlockHash , s . chain . GetConfig ( ) ) if err != nil { return nil , err } bb := primitives . BlockBody { Attestations : atts , ProposerSlashings : make ( [ ] primitives . ProposerSlashing , 0 ) , CasperSlashings : make ( [ ] primitives . CasperSlashing , 0 ) , Deposits : make ( [ ] primitives . Deposit , 0 ) , Exits : make ( [ ] primitives . Exit , 0 ) , } return bb . ToProto ( ) , nil }
GetMempool gets the mempool for a block.
GetMempool gets the mempool for a block .