Query queries req from local chain state and returns the query results in resp.
( req *types.Request, isLeader bool)
| 1023 | |
| 1024 | // Query queries req from local chain state and returns the query results in resp. |
| 1025 | func (c *Chain) Query( |
| 1026 | req *types.Request, isLeader bool) (tracker *x.QueryTracker, resp *types.Response, err error, |
| 1027 | ) { |
| 1028 | // TODO(leventeliu): we're using an external context passed by request. Make sure that |
| 1029 | // cancelling will be propagated to this context before chain instance stops. |
| 1030 | // update metrics |
| 1031 | c.expVars.Get(mwMinerChainRequestsCount).(mw.Metric).Add(1) |
| 1032 | |
| 1033 | return c.st.QueryWithContext(req.GetContext(), req, isLeader) |
| 1034 | } |
| 1035 | |
| 1036 | // AddResponse addes a response to the ackIndex, awaiting for acknowledgement. |
| 1037 | func (c *Chain) AddResponse(resp *types.SignedResponseHeader) (err error) { |
nothing calls this directly
no test coverage detected