From eaf47b2da9bdf9e3b89ab39f3067712fb89809ae Mon Sep 17 00:00:00 2001 From: zsfelfoldi Date: Sun, 10 Jul 2016 14:09:13 +0200 Subject: [PATCH] internal/ethapi: fix eth_call nonce bug --- internal/ethapi/api.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 6e888fc93b..adb97e4070 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -579,10 +579,15 @@ func (s *PublicBlockChainAPI) doCall(ctx context.Context, args CallArgs, blockNr } else { addr = args.From } + nonce, err := state.GetNonce(ctx, addr) + if err != nil { + return "0x", common.Big0, err + } // Assemble the CALL invocation msg := callmsg{ addr: addr, + nonce: nonce, to: args.To, gas: args.Gas.BigInt(), gasPrice: args.GasPrice.BigInt(), @@ -698,10 +703,15 @@ func (s *PublicBlockChainAPI) TraceCall(ctx context.Context, args CallArgs, bloc } else { addr = args.From } + nonce, err := state.GetNonce(ctx, addr) + if err != nil { + return nil, err + } // Assemble the CALL invocation msg := callmsg{ addr: addr, + nonce: nonce, to: args.To, gas: args.Gas.BigInt(), gasPrice: args.GasPrice.BigInt(),