From d3c8f295c2b4ecae300c5bcf236652ebea471933 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Tue, 11 Aug 2020 12:24:00 +0200 Subject: [PATCH] Use real blockProbabilities function Signed-off-by: Jakub Sztandera --- chain/messagepool/selection.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/chain/messagepool/selection.go b/chain/messagepool/selection.go index 6cc19b7f3..0627a4638 100644 --- a/chain/messagepool/selection.go +++ b/chain/messagepool/selection.go @@ -3,7 +3,6 @@ package messagepool import ( "context" "math/big" - "math/rand" "sort" "time" @@ -281,24 +280,6 @@ tailLoop: return result, nil } -func (mp *MessagePool) blockProbabilities(tq float64) []float64 { - // TODO FIXME fit in the actual probability distribution - // this just makes a dummy random distribution for testing purposes - bps := make([]float64, MaxBlocks) - norm := 0.0 - for i := 0; i < MaxBlocks; i++ { - p := rand.Float64() - bps[i] = p - norm += p - } - // normalize to make it a distribution - for i := 0; i < MaxBlocks; i++ { - bps[i] /= norm - } - - return bps -} - func (mp *MessagePool) selectMessagesGreedy(curTs, ts *types.TipSet) ([]*types.SignedMessage, error) { start := time.Now()