use RequiredFunds in chain inclusion balance sanity check

This commit is contained in:
vyzo 2020-08-05 13:08:07 +03:00
parent 06a13681ae
commit b4be1472c0

View File

@ -188,11 +188,13 @@ func (mp *MessagePool) createMessageChains(actor address.Address, mset *msgSet,
break break
} }
gasReward := mp.getGasReward(m, ts) required := m.Message.RequiredFunds().Int
if gasReward.Cmp(balance) > 0 { if balance.Cmp(required) < 0 {
break break
} }
balance = new(big.Int).Sub(balance, gasReward) balance = new(big.Int).Sub(balance, required)
gasReward := mp.getGasReward(m, ts)
rewards = append(rewards, gasReward) rewards = append(rewards, gasReward)
} }