FetchBlock is the RPC method to fetch a known block from the target server.
(req *types.FetchBlockReq, resp *types.FetchBlockResp)
| 36 | |
| 37 | // FetchBlock is the RPC method to fetch a known block from the target server. |
| 38 | func (s *ChainRPCService) FetchBlock(req *types.FetchBlockReq, resp *types.FetchBlockResp) error { |
| 39 | resp.Height = req.Height |
| 40 | block, count, err := s.chain.fetchBlockByHeight(req.Height) |
| 41 | if err != nil { |
| 42 | return err |
| 43 | } |
| 44 | resp.Block = block |
| 45 | resp.Count = count |
| 46 | return err |
| 47 | } |
| 48 | |
| 49 | // FetchLastIrreversibleBlock fetches the last block irreversible block from block producer. |
| 50 | func (s *ChainRPCService) FetchLastIrreversibleBlock( |
nothing calls this directly
no test coverage detected