mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
add : check for commit span in apply bor message
This commit is contained in:
parent
c8548c9d37
commit
b88d00c7af
1 changed files with 6 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
package statefull
|
package statefull
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"math"
|
"math"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
@ -90,7 +91,11 @@ func ApplyMessage(
|
||||||
|
|
||||||
success := big.NewInt(5).SetBytes(ret)
|
success := big.NewInt(5).SetBytes(ret)
|
||||||
|
|
||||||
if success.Cmp(big.NewInt(0)) == 0 {
|
validatorContract := common.HexToAddress(chainConfig.Bor.ValidatorContract)
|
||||||
|
|
||||||
|
// if success == 0 and msg.To() != validatorContractAddress, log Error
|
||||||
|
// if msg.To() == validatorContractAddress, its committing a span and we don't get any return value
|
||||||
|
if success.Cmp(big.NewInt(0)) == 0 && !bytes.Equal(msg.To().Bytes(), validatorContract.Bytes()) {
|
||||||
log.Error("message execution failed on contract", "msgData", msg.Data)
|
log.Error("message execution failed on contract", "msgData", msg.Data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue