aboutsummaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-20 08:05:48 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-20 08:05:48 +0800
commit6fef6168705a9e70f36560b100d276092ecb5bff (patch)
treed77ab9df67e8e07c4c305bc81d56bc733332da26 /rpc
parentd28cd0f04086ce618f16b5019d2fd3992469755a (diff)
downloaddexon-6fef6168705a9e70f36560b100d276092ecb5bff.tar
dexon-6fef6168705a9e70f36560b100d276092ecb5bff.tar.gz
dexon-6fef6168705a9e70f36560b100d276092ecb5bff.tar.bz2
dexon-6fef6168705a9e70f36560b100d276092ecb5bff.tar.lz
dexon-6fef6168705a9e70f36560b100d276092ecb5bff.tar.xz
dexon-6fef6168705a9e70f36560b100d276092ecb5bff.tar.zst
dexon-6fef6168705a9e70f36560b100d276092ecb5bff.zip
inline DbPut
Diffstat (limited to 'rpc')
-rw-r--r--rpc/api.go18
1 files changed, 7 insertions, 11 deletions
diff --git a/rpc/api.go b/rpc/api.go
index 432959bc2..62b8199f1 100644
--- a/rpc/api.go
+++ b/rpc/api.go
@@ -303,16 +303,6 @@ func (p *EthereumApi) GetStorageAt(args *GetStorageAtArgs, reply *interface{}) e
return nil
}
-func (p *EthereumApi) DbPut(args *DbArgs, reply *interface{}) error {
- if err := args.requirements(); err != nil {
- return err
- }
-
- p.db.Put([]byte(args.Database+args.Key), []byte(args.Value))
- *reply = true
- return nil
-}
-
func (p *EthereumApi) DbGet(args *DbArgs, reply *interface{}) error {
if err := args.requirements(); err != nil {
return err
@@ -711,7 +701,13 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
if err := json.Unmarshal(req.Params, &args); err != nil {
return err
}
- return p.DbPut(args, reply)
+
+ if err := args.requirements(); err != nil {
+ return err
+ }
+
+ p.db.Put([]byte(args.Database+args.Key), []byte(args.Value))
+ *reply = true
case "db_getString":
args := new(DbArgs)
if err := json.Unmarshal(req.Params, &args); err != nil {