mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
core: use parse delegation for code check in state transition
This commit is contained in:
parent
f9e0222507
commit
f32e9bfe36
1 changed files with 2 additions and 2 deletions
|
|
@ -17,7 +17,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"math"
|
||||
"math/big"
|
||||
|
|
@ -310,7 +309,8 @@ func (st *stateTransition) preCheck() error {
|
|||
if !msg.SkipFromEOACheck {
|
||||
// Make sure the sender is an EOA
|
||||
code := st.state.GetCode(msg.From)
|
||||
if len(code) > 0 && !bytes.HasPrefix(code, types.DelegationPrefix) {
|
||||
_, delegated := types.ParseDelegation(code)
|
||||
if len(code) > 0 && !delegated {
|
||||
return fmt.Errorf("%w: address %v, len(code): %d", ErrSenderNoEOA, msg.From.Hex(), len(code))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue