mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 18:13:54 +08:00
refactor: context first in argument list
(merely by convention) License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:

committed by
Juan Batiz-Benet

parent
f66d94aaf1
commit
10e970c0cf
@ -56,7 +56,7 @@ func New(parent context.Context, p peer.Peer, network bsnet.BitSwapNetwork, rout
|
||||
blockstore: bstore,
|
||||
cancelFunc: cancelFunc,
|
||||
notifications: notif,
|
||||
ledgermanager: strategy.NewLedgerManager(bstore, ctx),
|
||||
ledgermanager: strategy.NewLedgerManager(ctx, bstore),
|
||||
routing: routing,
|
||||
sender: network,
|
||||
wantlist: wl.New(),
|
||||
|
@ -34,7 +34,7 @@ type LedgerManager struct {
|
||||
workSignal chan struct{}
|
||||
}
|
||||
|
||||
func NewLedgerManager(bs bstore.Blockstore, ctx context.Context) *LedgerManager {
|
||||
func NewLedgerManager(ctx context.Context, bs bstore.Blockstore) *LedgerManager {
|
||||
lm := &LedgerManager{
|
||||
ledgerMap: make(ledgerMap),
|
||||
bs: bs,
|
||||
|
@ -23,7 +23,8 @@ func newPeerAndLedgermanager(idStr string) peerAndLedgermanager {
|
||||
return peerAndLedgermanager{
|
||||
Peer: testutil.NewPeerWithIDString(idStr),
|
||||
//Strategy: New(true),
|
||||
ls: NewLedgerManager(blockstore.NewBlockstore(sync.MutexWrap(ds.NewMapDatastore())), context.TODO()),
|
||||
ls: NewLedgerManager(context.TODO(),
|
||||
blockstore.NewBlockstore(sync.MutexWrap(ds.NewMapDatastore()))),
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user