Use real blockProbabilities function

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-08-11 12:24:00 +02:00
parent 080614098d
commit d3c8f295c2
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

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