Small fixes to mpool Trim
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
parent
d6f9383528
commit
2efb18f677
@ -811,12 +811,15 @@ func (mc *msgChain) Trim(gasLimit int64, mp *MessagePool, baseFee types.BigInt,
|
|||||||
mc.gasLimit -= mc.msgs[i].Message.GasLimit
|
mc.gasLimit -= mc.msgs[i].Message.GasLimit
|
||||||
if mc.gasLimit > 0 {
|
if mc.gasLimit > 0 {
|
||||||
bp := 1.0
|
bp := 1.0
|
||||||
if mc.effPerf != 0 {
|
if mc.gasPerf != 0 { // prevent div by 0
|
||||||
bp = mc.effPerf / mc.gasPerf
|
bp = mc.effPerf / mc.gasPerf
|
||||||
}
|
}
|
||||||
|
|
||||||
mc.gasPerf = mp.getGasPerf(mc.gasReward, mc.gasLimit)
|
mc.gasPerf = mp.getGasPerf(mc.gasReward, mc.gasLimit)
|
||||||
mc.effPerf = bp * mc.gasPerf
|
|
||||||
|
if mc.effPerf != 0 { // keep effPerf 0 if it is 0
|
||||||
|
mc.effPerf = bp * mc.gasPerf
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mc.gasPerf = 0
|
mc.gasPerf = 0
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user