Browse Source

added NOTE on inefficiency.

pull/40/head
Jae Kwon 9 years ago
parent
commit
513decfc5a
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      block/pool.go

+ 2
- 0
block/pool.go View File

@ -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))


Loading…
Cancel
Save