mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
Fix nil pointer exception, statedb received in LastStateId can be nil
This commit is contained in:
parent
f6679a1c19
commit
3a5287750a
1 changed files with 5 additions and 2 deletions
|
|
@ -123,8 +123,11 @@ func (gc *GenesisContractsClient) LastStateId(stateDB vm.StateDB, number uint64,
|
|||
toAddress := common.HexToAddress(gc.StateReceiverContract)
|
||||
gas := (hexutil.Uint64)(uint64(math.MaxUint64 / 2))
|
||||
|
||||
var original *state.StateDB
|
||||
if stateDB != nil {
|
||||
// The unhooked version always return the *state.StateDB inner object
|
||||
original := stateDB.Unhooked().(*state.StateDB)
|
||||
original = stateDB.Unhooked().(*state.StateDB)
|
||||
}
|
||||
|
||||
// BOR: Do a 'CallWithState' so that we can fetch the last state ID from a given (incoming)
|
||||
// state instead of local(canonical) chain's state.
|
||||
|
|
|
|||
Loading…
Reference in a new issue