Function
NewP2pRequest
(ctx context.Context, rType int, id []byte, addr string, msg proto.Message, nonce uint64)
Source from the content-addressed store, hash-verified
| 28 | } |
| 29 | |
| 30 | func NewP2pRequest(ctx context.Context, rType int, id []byte, addr string, msg proto.Message, nonce uint64) (req *p2pRequest) { |
| 31 | rctx, cancel := context.WithCancel(ctx) |
| 32 | req = &p2pRequest{ctx: rctx, cancel: cancel, id: id, msg: msg, rType: rType, nonce: nonce, reply: make(chan p2pResult)} |
| 33 | return |
| 34 | } |
| 35 | func (r *p2pRequest) sendReq(ch chan p2pRequest) (err error) { |
| 36 | select { |
| 37 | case ch <- *r: |
Tested by
no test coverage detected