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

Method dropPeer

protocols/cpc/fetcher/fetcher_test.go:140–145  ·  view source on GitHub ↗

dropPeer is an emulator for the peer removal, simply accumulating the various peers dropped by the fetcher.

(peer string)

Source from the content-addressed store, hash-verified

138// dropPeer is an emulator for the peer removal, simply accumulating the various
139// peers dropped by the fetcher.
140func (f *fetcherTester) dropPeer(peer string) {
141 f.lock.Lock()
142 defer f.lock.Unlock()
143
144 f.drops[peer] = true
145}
146
147// makeHeaderFetcher retrieves a block header fetcher associated with a simulated peer.
148func (f *fetcherTester) makeHeaderFetcher(peer string, blocks map[common.Hash]*types.Block, drift time.Duration) headerRequesterFn {

Callers 3

loopMethod · 0.80
insertMethod · 0.80
SynchroniseMethod · 0.80

Calls 2

LockMethod · 0.80
UnlockMethod · 0.80

Tested by

no test coverage detected