parent
15764f7bb2
commit
40cb489097
|
@ -125,7 +125,7 @@ var Defaults Option = func(cfg *Config) error {
|
|||
}
|
||||
|
||||
// FallbackDefaults applies default options to the libp2p node if and only if no
|
||||
// other relevent options have been applied. will be appended to the options
|
||||
// other relevant options have been applied. will be appended to the options
|
||||
// passed into New.
|
||||
var FallbackDefaults Option = func(cfg *Config) error {
|
||||
for _, def := range defaults {
|
||||
|
|
|
@ -363,7 +363,7 @@ func TestProtoDowngrade(t *testing.T) {
|
|||
|
||||
h1.Network().ConnsToPeer(h2.ID())[0].Close()
|
||||
|
||||
time.Sleep(time.Millisecond * 50) // allow notifications to propogate
|
||||
time.Sleep(time.Millisecond * 50) // allow notifications to propagate
|
||||
h1.RemoveStreamHandler("/testing/1.0.0")
|
||||
h1.SetStreamHandler("/testing", func(s network.Stream) {
|
||||
connectedOn <- s.Protocol()
|
||||
|
|
|
@ -51,7 +51,7 @@ type Mocknet interface {
|
|||
UnlinkNets(network.Network, network.Network) error
|
||||
|
||||
// LinkDefaults are the default options that govern links
|
||||
// if they do not have thier own option set.
|
||||
// if they do not have their own option set.
|
||||
SetLinkDefaults(LinkOptions)
|
||||
LinkDefaults() LinkOptions
|
||||
|
||||
|
|
|
@ -286,7 +286,7 @@ func (mn *mocknet) UnlinkNets(n1, n2 network.Network) error {
|
|||
return mn.UnlinkPeers(n1.LocalPeer(), n2.LocalPeer())
|
||||
}
|
||||
|
||||
// get from the links map. and lazily contruct.
|
||||
// get from the links map. and lazily construct.
|
||||
func (mn *mocknet) linksMapGet(p1, p2 peer.ID) map[*link]struct{} {
|
||||
|
||||
l1, found := mn.links[p1]
|
||||
|
|
|
@ -475,7 +475,7 @@ func HasConsistentTransport(a ma.Multiaddr, green []ma.Multiaddr) bool {
|
|||
// IdentifyWait returns a channel which will be closed once
|
||||
// "ProtocolIdentify" (handshake3) finishes on given conn.
|
||||
// This happens async so the connection can start to be used
|
||||
// even if handshake3 knowledge is not necesary.
|
||||
// even if handshake3 knowledge is not necessary.
|
||||
// Users **MUST** call IdentifyWait _after_ IdentifyConn
|
||||
func (ids *IDService) IdentifyWait(c network.Conn) <-chan struct{} {
|
||||
ids.currmu.Lock()
|
||||
|
|
|
@ -160,7 +160,7 @@ func testHasPublicKey(t *testing.T, h host.Host, p peer.ID, shouldBe ic.PubKey)
|
|||
}
|
||||
|
||||
// TestIDServiceWait gives the ID service 1s to finish after dialing
|
||||
// this is becasue it used to be concurrent. Now, Dial wait till the
|
||||
// this is because it used to be concurrent. Now, Dial wait till the
|
||||
// id service is done.
|
||||
func TestIDService(t *testing.T) {
|
||||
oldTTL := peerstore.RecentlyConnectedAddrTTL
|
||||
|
|
|
@ -330,7 +330,7 @@ func TestStBackpressureStreamWrite(t *testing.T) {
|
|||
}
|
||||
roundsTime := time.Since(roundsStart)
|
||||
|
||||
// now read continously, while we measure stats.
|
||||
// now read continuously, while we measure stats.
|
||||
stop := make(chan struct{})
|
||||
contStart := time.Now()
|
||||
|
||||
|
|
Loading…
Reference in New Issue