diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-20 12:24:23 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-20 12:24:23 +0800 |
commit | b56e20be2760343147f72ca62a8db8bd216903bf (patch) | |
tree | 494ba55c1bd85839e2620676f33534f42a93777c /rpc | |
parent | 754160afea7fc230c3236d5494beefeb03b94140 (diff) | |
download | dexon-b56e20be2760343147f72ca62a8db8bd216903bf.tar dexon-b56e20be2760343147f72ca62a8db8bd216903bf.tar.gz dexon-b56e20be2760343147f72ca62a8db8bd216903bf.tar.bz2 dexon-b56e20be2760343147f72ca62a8db8bd216903bf.tar.lz dexon-b56e20be2760343147f72ca62a8db8bd216903bf.tar.xz dexon-b56e20be2760343147f72ca62a8db8bd216903bf.tar.zst dexon-b56e20be2760343147f72ca62a8db8bd216903bf.zip |
Reorg for clarity
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/api.go | 82 |
1 files changed, 30 insertions, 52 deletions
diff --git a/rpc/api.go b/rpc/api.go index 1626fd0af..fccc7f2a4 100644 --- a/rpc/api.go +++ b/rpc/api.go @@ -43,59 +43,7 @@ func (self *EthereumApi) xeth() *xeth.XEth { return self.eth } -// func (self *EthereumApi) Register(args string, reply *interface{}) error { -// self.regmut.Lock() -// defer self.regmut.Unlock() - -// if _, ok := self.register[args]; ok { -// self.register[args] = nil // register with empty -// } -// return nil -// } - -// func (self *EthereumApi) Unregister(args string, reply *interface{}) error { -// self.regmut.Lock() -// defer self.regmut.Unlock() - -// delete(self.register, args) - -// return nil -// } - -// func (self *EthereumApi) WatchTx(args string, reply *interface{}) error { -// self.regmut.Lock() -// defer self.regmut.Unlock() - -// txs := self.register[args] -// self.register[args] = nil - -// *reply = txs -// return nil -// } - func (p *EthereumApi) Transact(args *NewTxArgs, reply *interface{}) (err error) { - // TODO if no_private_key then - //if _, exists := p.register[args.From]; exists { - // p.register[args.From] = append(p.register[args.From], args) - //} else { - /* - account := accounts.Get(common.FromHex(args.From)) - if account != nil { - if account.Unlocked() { - if !unlockAccount(account) { - return - } - } - - result, _ := account.Transact(common.FromHex(args.To), common.FromHex(args.Value), common.FromHex(args.Gas), common.FromHex(args.GasPrice), common.FromHex(args.Data)) - if len(result) > 0 { - *reply = common.ToHex(result) - } - } else if _, exists := p.register[args.From]; exists { - p.register[ags.From] = append(p.register[args.From], args) - } - */ - if err := args.requirements(); err != nil { return err } @@ -163,6 +111,36 @@ func (p *EthereumApi) GetBlockByNumber(blocknum int64, includetx bool) (*BlockRe return br, nil } +// func (self *EthereumApi) Register(args string, reply *interface{}) error { +// self.regmut.Lock() +// defer self.regmut.Unlock() + +// if _, ok := self.register[args]; ok { +// self.register[args] = nil // register with empty +// } +// return nil +// } + +// func (self *EthereumApi) Unregister(args string, reply *interface{}) error { +// self.regmut.Lock() +// defer self.regmut.Unlock() + +// delete(self.register, args) + +// return nil +// } + +// func (self *EthereumApi) WatchTx(args string, reply *interface{}) error { +// self.regmut.Lock() +// defer self.regmut.Unlock() + +// txs := self.register[args] +// self.register[args] = nil + +// *reply = txs +// return nil +// } + func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error { // Spec at https://github.com/ethereum/wiki/wiki/Generic-JSON-RPC rpclogger.Infof("%s %s", req.Method, req.Params) |