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

Struct peer

protocols/cpc/peer.go:63–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63type peer struct {
64 id string
65
66 *p2p.Peer
67 rw p2p.MsgReadWriter
68
69 version int // Protocol version negotiated
70 forkDrop *time.Timer // Timed connection dropper if forks aren't validated in time
71
72 head common.Hash
73 ht *big.Int
74 lock sync.RWMutex
75
76 knownTxs *set.Set // Set of transaction hashes known to be known by this peer
77 knownBlocks *set.Set // Set of block hashes known to be known by this peer
78
79 queuedTxs chan []*types.Transaction // Queue of transactions to broadcast to the peer
80 queuedProps chan *propEvent // Queue of blocks to broadcast to the peer
81 queuedAnns chan *types.Block // Queue of blocks to announce to the peer
82
83 term chan struct{} // Termination channel to stop the broadcaster
84}
85
86func newPeer(version int, p *p2p.Peer, rw p2p.MsgReadWriter) *peer {
87 return &peer{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected