MCPcopy Create free account
hub / github.com/DNAProject/DNA / Send

Method Send

p2pserver/p2pserver.go:180–188  ·  view source on GitHub ↗

Send tranfer buffer to peer

(p *peer.Peer, msg msgtypes.Message,
	isConsensus bool)

Source from the content-addressed store, hash-verified

178
179//Send tranfer buffer to peer
180func (this *P2PServer) Send(p *peer.Peer, msg msgtypes.Message,
181 isConsensus bool) error {
182 if this.network.IsPeerEstablished(p) {
183 return this.network.Send(p, msg)
184 }
185 log.Warnf("[p2p]send to a not ESTABLISH peer %d",
186 p.GetID())
187 return errors.New("[p2p]send to a not ESTABLISH peer")
188}
189
190// GetID returns local node id
191func (this *P2PServer) GetID() uint64 {

Callers 2

reqNbrListMethod · 0.95
pingToMethod · 0.95

Calls 4

WarnfFunction · 0.92
IsPeerEstablishedMethod · 0.65
SendMethod · 0.65
GetIDMethod · 0.65

Tested by

no test coverage detected