account for message Value in balance calculation
This commit is contained in:
parent
7598a9d2fe
commit
2166e9a0ff
@ -313,6 +313,13 @@ func (mp *MessagePool) createMessageChains(actor address.Address, mset map[uint6
|
|||||||
}
|
}
|
||||||
balance = new(big.Int).Sub(balance, required)
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
gasReward := mp.getGasReward(m, ts)
|
gasReward := mp.getGasReward(m, ts)
|
||||||
rewards = append(rewards, gasReward)
|
rewards = append(rewards, gasReward)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user