Reply sends a reply to the specific node
(ctx context.Context, id []byte, nonce uint64, msg proto.Message)
| 352 | |
| 353 | // Reply sends a reply to the specific node |
| 354 | func (n *server) Reply(ctx context.Context, id []byte, nonce uint64, msg proto.Message) (err error) { |
| 355 | opCtx, opCancel := context.WithTimeout(ctx, 15*time.Second) |
| 356 | defer opCancel() |
| 357 | req := NewP2pRequest(opCtx, replyReq, id, "", msg, nonce) |
| 358 | if err = req.sendReq(n.replying); err != nil { |
| 359 | err = &P2PError{err: errors.Errorf("Reply sendReq failed: %w", err), dest: req.addr, t: time.Now()} |
| 360 | n.logger.Error(err) |
| 361 | return |
| 362 | } |
| 363 | if _, err = req.waitForResult(); err != nil { |
| 364 | err = &P2PError{err: errors.Errorf("Reply waitForResult failed: %w", err), dest: req.addr, t: time.Now()} |
| 365 | n.logger.Error(err) |
| 366 | } |
| 367 | return |
| 368 | } |
| 369 | |
| 370 | func (n *server) eventDispatch() { |
| 371 | var wg sync.WaitGroup |
nothing calls this directly
no test coverage detected