Skip to content

Commit

Permalink
Merge pull request #4668 from filecoin-project/fix/mpool-pricing
Browse files Browse the repository at this point in the history
Fix messagepool accounting
  • Loading branch information
magik6k authored Oct 30, 2020
2 parents c3d00b0 + 12f6119 commit 696a686
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions chain/messagepool/selection.go
Original file line number Diff line number Diff line change
Expand Up @@ -752,11 +752,10 @@ func (mp *MessagePool) createMessageChains(actor address.Address, mset map[uint6
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)
if balance.Cmp(value) < 0 {
break
}
balance = new(big.Int).Sub(balance, value)

gasReward := mp.getGasReward(m, baseFee)
rewards = append(rewards, gasReward)
Expand Down

0 comments on commit 696a686

Please sign in to comment.