swarm/network/stream: store kademlia in bucket

This commit is contained in:
Fabio Barone 2019-03-04 11:19:52 -05:00
parent 6d15944543
commit 4aed2a5e12

View file

@ -134,6 +134,9 @@ func netStoreAndDeliveryWithAddr(ctx *adapters.ServiceContext, bucket *sync.Map,
bucket.Store(bucketKeyDB, netStore) bucket.Store(bucketKeyDB, netStore)
bucket.Store(bucketKeyDelivery, delivery) bucket.Store(bucketKeyDelivery, delivery)
bucket.Store(bucketKeyFileStore, fileStore) bucket.Store(bucketKeyFileStore, fileStore)
// for the kademlia object, we use the global key from the simulation package,
// as the simulation will try to access it in the WaitTillHealthy with that key
bucket.Store(simulation.BucketKeyKademlia, kad)
cleanup := func() { cleanup := func() {
netStore.Close() netStore.Close()