only adjust next chains if they have positve perf

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
vyzo 2020-08-13 10:33:20 +03:00 committed by Jakub Sztandera
parent 7bbf1c7db2
commit 5e8ae7498a
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

@ -178,14 +178,14 @@ func (mp *MessagePool) selectMessagesOptimal(curTs, ts *types.TipSet, tq float64
curChain := chainDeps[i] curChain := chainDeps[i]
curChain.merged = true curChain.merged = true
// adjust the next chain for the parent, which is being merged // adjust the next chain for the parent, which is being merged
if next := curChain.next; next != nil { if next := curChain.next; next != nil && next.effPerf > 0 {
next.effPerf += next.parentOffset next.effPerf += next.parentOffset
} }
result = append(result, curChain.msgs...) result = append(result, curChain.msgs...)
} }
chain.merged = true chain.merged = true
if next := chain.next; next != nil { if next := chain.next; next != nil && next.effPerf > 0 {
next.effPerf += next.parentOffset next.effPerf += next.parentOffset
} }
result = append(result, chain.msgs...) result = append(result, chain.msgs...)