(ttl uint32, tx pi.Transaction)
| 55 | } |
| 56 | |
| 57 | func (c *Chain) nonblockingBroadcastTx(ttl uint32, tx pi.Transaction) { |
| 58 | for _, info := range c.getRemoteBPInfos() { |
| 59 | func(remote *blockProducerInfo) { |
| 60 | c.goFuncWithTimeout(func(ctx context.Context) { |
| 61 | var ( |
| 62 | req = &types.AddTxReq{ |
| 63 | Envelope: proto.Envelope{ |
| 64 | // TODO(lambda): Add fields. |
| 65 | }, |
| 66 | TTL: ttl, |
| 67 | Tx: tx, |
| 68 | } |
| 69 | err = c.caller.CallNodeWithContext( |
| 70 | ctx, remote.nodeID, route.MCCAddTx.String(), req, nil) |
| 71 | ) |
| 72 | log.WithFields(log.Fields{ |
| 73 | "local": c.getLocalBPInfo(), |
| 74 | "remote": remote, |
| 75 | "hash": tx.Hash().Short(4), |
| 76 | "address": tx.GetAccountAddress(), |
| 77 | "type": tx.GetTransactionType(), |
| 78 | }).WithError(err).Debug("broadcast transaction to other peers") |
| 79 | }, c.tick) |
| 80 | }(info) |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | func (c *Chain) blockingFetchBlock(ctx context.Context, h uint32) (unreachable uint32) { |
| 85 | var ( |
no test coverage detected