| 61 | } |
| 62 | |
| 63 | type 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 | |
| 86 | func newPeer(version int, p *p2p.Peer, rw p2p.MsgReadWriter) *peer { |
| 87 | return &peer{ |
nothing calls this directly
no outgoing calls
no test coverage detected