mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
Merge pull request #10889 from ipfs/reuse-connevtmanager
Some checks are pending
CodeQL / codeql (push) Waiting to run
Docker Build / docker-build (push) Waiting to run
Gateway Conformance / gateway-conformance (push) Waiting to run
Gateway Conformance / gateway-conformance-libp2p-experiment (push) Waiting to run
Go Build / go-build (push) Waiting to run
Go Check / go-check (push) Waiting to run
Go Lint / go-lint (push) Waiting to run
Go Test / go-test (push) Waiting to run
Interop / interop-prep (push) Waiting to run
Interop / helia-interop (push) Blocked by required conditions
Interop / ipfs-webui (push) Blocked by required conditions
Sharness / sharness-test (push) Waiting to run
Spell Check / spellcheck (push) Waiting to run
Some checks are pending
CodeQL / codeql (push) Waiting to run
Docker Build / docker-build (push) Waiting to run
Gateway Conformance / gateway-conformance (push) Waiting to run
Gateway Conformance / gateway-conformance-libp2p-experiment (push) Waiting to run
Go Build / go-build (push) Waiting to run
Go Check / go-check (push) Waiting to run
Go Lint / go-lint (push) Waiting to run
Go Test / go-test (push) Waiting to run
Interop / interop-prep (push) Waiting to run
Interop / helia-interop (push) Blocked by required conditions
Interop / ipfs-webui (push) Blocked by required conditions
Sharness / sharness-test (push) Waiting to run
Spell Check / spellcheck (push) Waiting to run
Bitswap: use a single ConnectEventManager.
This commit is contained in:
commit
58ad11b573
@ -88,9 +88,14 @@ func Bitswap(serverEnabled, libp2pEnabled, httpEnabled bool) interface{} {
|
||||
var bitswapNetworks, bitswapLibp2p network.BitSwapNetwork
|
||||
var bitswapBlockstore blockstore.Blockstore = in.Bs
|
||||
|
||||
connEvtMgr := network.NewConnectEventManager()
|
||||
|
||||
libp2pEnabled := in.Cfg.Bitswap.Libp2pEnabled.WithDefault(config.DefaultBitswapLibp2pEnabled)
|
||||
if libp2pEnabled {
|
||||
bitswapLibp2p = bsnet.NewFromIpfsHost(in.Host)
|
||||
bitswapLibp2p = bsnet.NewFromIpfsHost(
|
||||
in.Host,
|
||||
bsnet.WithConnectEventManager(connEvtMgr),
|
||||
)
|
||||
}
|
||||
|
||||
if httpEnabled {
|
||||
@ -112,6 +117,7 @@ func Bitswap(serverEnabled, libp2pEnabled, httpEnabled bool) interface{} {
|
||||
httpnet.WithMaxBlockSize(int64(maxBlockSize)),
|
||||
httpnet.WithUserAgent(version.GetUserAgentVersion()),
|
||||
httpnet.WithMetricsLabelsForEndpoints(httpCfg.Allowlist),
|
||||
httpnet.WithConnectEventManager(connEvtMgr),
|
||||
)
|
||||
bitswapNetworks = network.New(in.Host.Peerstore(), bitswapLibp2p, bitswapHTTP)
|
||||
} else if libp2pEnabled {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user