From 513decfc5a646efe1042f3d50a8289d193fbddd1 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Sun, 22 Mar 2015 16:31:29 -0700 Subject: [PATCH] added NOTE on inefficiency. --- block/pool.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/pool.go b/block/pool.go index 48d86c24..9656533f 100644 --- a/block/pool.go +++ b/block/pool.go @@ -181,6 +181,8 @@ func (bp *BlockPool) handleEvent(event_ interface{}) { } } +// NOTE: This function is sufficient, but we should find pending blocks +// and sample the peers in one go rather than the current O(n^2) impl. func (bp *BlockPool) requestBlocksFromRandomPeers(maxPeers int) { chosen := bp.pickAvailablePeers(maxPeers) log.Debug("requestBlocksFromRandomPeers", "chosen", len(chosen))