mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
fixed call nonce/empty trie bug
This commit is contained in:
parent
8c3701c7c5
commit
68ae0c411d
2 changed files with 11 additions and 1 deletions
|
|
@ -579,10 +579,15 @@ func (s *PublicBlockChainAPI) doCall(ctx context.Context, args CallArgs, blockNr
|
||||||
} else {
|
} else {
|
||||||
addr = args.From
|
addr = args.From
|
||||||
}
|
}
|
||||||
|
nonce, err := state.GetNonce(ctx, addr)
|
||||||
|
if err != nil {
|
||||||
|
return "0x", common.Big0, err
|
||||||
|
}
|
||||||
|
|
||||||
// Assemble the CALL invocation
|
// Assemble the CALL invocation
|
||||||
msg := callmsg{
|
msg := callmsg{
|
||||||
addr: addr,
|
addr: addr,
|
||||||
|
nonce: nonce,
|
||||||
to: args.To,
|
to: args.To,
|
||||||
gas: args.Gas.BigInt(),
|
gas: args.Gas.BigInt(),
|
||||||
gasPrice: args.GasPrice.BigInt(),
|
gasPrice: args.GasPrice.BigInt(),
|
||||||
|
|
@ -698,10 +703,15 @@ func (s *PublicBlockChainAPI) TraceCall(ctx context.Context, args CallArgs, bloc
|
||||||
} else {
|
} else {
|
||||||
addr = args.From
|
addr = args.From
|
||||||
}
|
}
|
||||||
|
nonce, err := state.GetNonce(ctx, addr)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
// Assemble the CALL invocation
|
// Assemble the CALL invocation
|
||||||
msg := callmsg{
|
msg := callmsg{
|
||||||
addr: addr,
|
addr: addr,
|
||||||
|
nonce: nonce,
|
||||||
to: args.To,
|
to: args.To,
|
||||||
gas: args.Gas.BigInt(),
|
gas: args.Gas.BigInt(),
|
||||||
gasPrice: args.GasPrice.BigInt(),
|
gasPrice: args.GasPrice.BigInt(),
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ func NewStateObject(address common.Address, odr OdrBackend) *StateObject {
|
||||||
codeHash: emptyCodeHash,
|
codeHash: emptyCodeHash,
|
||||||
storage: make(Storage),
|
storage: make(Storage),
|
||||||
}
|
}
|
||||||
object.trie = NewLightTrie(nil, odr, true)
|
object.trie = NewLightTrie(&TrieID{}, odr, true)
|
||||||
return object
|
return object
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue