remove excessive time.Now() calls from bitswap sessions
License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
Steven Allen committed
Feb 8, 2018 at 17:48 UTC
2b99858dda9d1f24ec33f38e982c2abde333cc4c
1 file changed
+2
-1
exchange/bitswap/session.go
+2
-1
@@ -279,8 +279,9 @@ func (s *Session) receiveBlock(ctx context.Context, blk blocks.Block) {
279
}
280
281
func (s *Session) wantBlocks(ctx context.Context, ks []*cid.Cid) {
282
+ now := time.Now()
283
for _, c := range ks {
283
- s.liveWants[c.KeyString()] = time.Now()
284
+ s.liveWants[c.KeyString()] = now
285
}
286
s.bs.wm.WantBlocks(ctx, ks, s.activePeersArr, s.id)
287
}