MCPcopy Create free account
hub / github.com/CPChain/chain / SendTransactions

Method SendTransactions

protocols/cpc/peer.go:191–197  ·  view source on GitHub ↗

SendTransactions sends transactions to the peer and includes the hashes in its transaction hash set for future reference.

(txs types.Transactions)

Source from the content-addressed store, hash-verified

189// SendTransactions sends transactions to the peer and includes the hashes
190// in its transaction hash set for future reference.
191func (p *peer) SendTransactions(txs types.Transactions) error {
192 for _, tx := range txs {
193 log.Debug("send tx", "tx", tx.Hash().Hex(), "remoteAddr", p.RemoteAddr().String())
194 p.knownTxs.Add(tx.Hash())
195 }
196 return p2p.Send(p.rw, TxMsg, txs)
197}
198
199// AsyncSendTransactions queues list of transactions propagation to a remote
200// peer. If the peer's broadcast queue is full, the event is silently dropped.

Callers 2

broadcastMethod · 0.95
txsyncLoopMethod · 0.80

Calls 5

DebugMethod · 0.80
HashMethod · 0.65
AddMethod · 0.65
StringMethod · 0.45
RemoteAddrMethod · 0.45

Tested by

no test coverage detected