Skip to content

Commit

Permalink
Fix messagepool accounting
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Sztandera <[email protected]>
  • Loading branch information
Jakub Sztandera committed Oct 30, 2020
1 parent c3d00b0 commit 8afceee
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions chain/messagepool/selection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8afceee

Please sign in to comment.