core, miner: revert block gas counter in case of invalid transaction (#26799)

This change fixes a flaw where, in certain scenarios, the block sealer did not accurately reset the remaining gas after failing to include an invalid transaction. Fixes #26791
This commit is contained in:
rjl493456442
2023-03-07 05:23:52 -05:00
committed by GitHub
parent 4688d3c8f4
commit 77e33e5a49
3 changed files with 17 additions and 4 deletions
+5
View File
@@ -49,6 +49,11 @@ func (gp *GasPool) Gas() uint64 {
return uint64(*gp)
}
// SetGas sets the amount of gas with the provided number.
func (gp *GasPool) SetGas(gas uint64) {
*(*uint64)(gp) = gas
}
func (gp *GasPool) String() string {
return fmt.Sprintf("%d", *gp)
}