MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / FetchBlock

Method FetchBlock

blockproducer/rpc.go:38–47  ·  view source on GitHub ↗

FetchBlock is the RPC method to fetch a known block from the target server.

(req *types.FetchBlockReq, resp *types.FetchBlockResp)

Source from the content-addressed store, hash-verified

36
37// FetchBlock is the RPC method to fetch a known block from the target server.
38func (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.
50func (s *ChainRPCService) FetchLastIrreversibleBlock(

Callers

nothing calls this directly

Calls 1

fetchBlockByHeightMethod · 0.80

Tested by

no test coverage detected