diff options
Diffstat (limited to 'rpc/api.go')
-rw-r--r-- | rpc/api.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/rpc/api.go b/rpc/api.go index bf5066f9a..c02b03fb6 100644 --- a/rpc/api.go +++ b/rpc/api.go @@ -2,7 +2,7 @@ package rpc import ( "encoding/json" - // "fmt" + "fmt" "math/big" "sync" @@ -167,6 +167,15 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err return err } + // call ConfirmTransaction first + var obj []json.RawMessage + if err := json.Unmarshal(req.Params, &obj); err != nil { + return NewDecodeParamError(err.Error()) + } + if !api.xeth().ConfirmTransaction(string(obj[0])) { + return fmt.Errorf("Transaction not confirmed") + } + v, err := api.xeth().Transact(args.From, args.To, args.Value.String(), args.Gas.String(), args.GasPrice.String(), args.Data) if err != nil { return err |