提交 2b99858d 作者: Steven Allen

remove excessive time.Now() calls from bitswap sessions

License: MIT
Signed-off-by: 's avatarSteven Allen <steven@stebalien.com>
上级 64c19cc9
...@@ -279,8 +279,9 @@ func (s *Session) receiveBlock(ctx context.Context, blk blocks.Block) { ...@@ -279,8 +279,9 @@ func (s *Session) receiveBlock(ctx context.Context, blk blocks.Block) {
} }
func (s *Session) wantBlocks(ctx context.Context, ks []*cid.Cid) { func (s *Session) wantBlocks(ctx context.Context, ks []*cid.Cid) {
now := time.Now()
for _, c := range ks { for _, c := range ks {
s.liveWants[c.KeyString()] = time.Now() s.liveWants[c.KeyString()] = now
} }
s.bs.wm.WantBlocks(ctx, ks, s.activePeersArr, s.id) s.bs.wm.WantBlocks(ctx, ks, s.activePeersArr, s.id)
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论