Fix messagepool accounting

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-10-30 19:21:25 +01:00
parent c3d00b0ac6
commit 8afceee7a9
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

@ -750,13 +750,7 @@ func (mp *MessagePool) createMessageChains(actor address.Address, mset map[uint6
break
}
balance = new(big.Int).Sub(balance, required)
value := m.Message.Value.Int
if balance.Cmp(value) >= 0 {
// Note: we only account for the value if the balance doesn't drop below 0
// otherwise the message will fail and the miner can reap the gas rewards
balance = new(big.Int).Sub(balance, value)
}
balance = new(big.Int).Sub(balance, m.Message.Value.Int)
gasReward := mp.getGasReward(m, baseFee)
rewards = append(rewards, gasReward)