MCPcopy Index your code
hub / github.com/hyperledger/fabric / serialSendAsync

Method serialSendAsync

core/chaincode/handler.go:357–373  ·  view source on GitHub ↗

serialSendAsync serves the same purpose as serialSend (serialize msgs so gRPC will be happy). In addition, it is also asynchronous so send-remoterecv--localrecv loop can be nonblocking. Only errors need to be handled and these are handled by communication on supplied error channel. A typical use wil

(msg *pb.ChaincodeMessage)

Source from the content-addressed store, hash-verified

355// communication on supplied error channel. A typical use will be a non-blocking or
356// nil channel
357func (h *Handler) serialSendAsync(msg *pb.ChaincodeMessage) {
358 go func() {
359 if err := h.serialSend(msg); err != nil {
360 // provide an error response to the caller
361 resp := &pb.ChaincodeMessage{
362 Type: pb.ChaincodeMessage_ERROR,
363 Payload: []byte(err.Error()),
364 Txid: msg.Txid,
365 ChannelId: msg.ChannelId,
366 }
367 h.Notify(resp)
368
369 // surface send error to stream processing
370 h.errChan <- err
371 }
372 }()
373}
374
375// Check if the transactor is allow to call this chaincode on this channel
376func (h *Handler) checkACL(signedProp *pb.SignedProposal, proposal *pb.Proposal, ccIns *sysccprovider.ChaincodeInstance) error {

Callers 3

HandleTransactionMethod · 0.95
ProcessStreamMethod · 0.95
ExecuteMethod · 0.95

Calls 3

serialSendMethod · 0.95
NotifyMethod · 0.95
ErrorMethod · 0.65

Tested by

no test coverage detected