diff options
Diffstat (limited to 'rpc/api.go')
-rw-r--r-- | rpc/api.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/rpc/api.go b/rpc/api.go index 4b61fa3a5..66283752b 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,12 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err return err } + // call ConfirmTransaction first + tx, _ := json.Marshal(req) + if !api.xeth().ConfirmTransaction(string(tx)) { + 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 @@ -182,8 +188,8 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err if err != nil { return err } - - *reply = v + // TODO unwrap the parent method's ToHex call + *reply = newHexData(common.FromHex(v)) case "eth_flush": return NewNotImplementedError(req.Method) case "eth_getBlockByHash": |