aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-20 08:40:50 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-20 08:40:50 +0800
commitcdfc03dc8e11a1738cad8009095549ea2d4b8287 (patch)
tree118b1319eae59b0c2ca79d864dbec930b01f29fd /rpc/api.go
parent0895190b64204205ed9cbc52a65b1060db4e43b4 (diff)
downloaddexon-cdfc03dc8e11a1738cad8009095549ea2d4b8287.tar
dexon-cdfc03dc8e11a1738cad8009095549ea2d4b8287.tar.gz
dexon-cdfc03dc8e11a1738cad8009095549ea2d4b8287.tar.bz2
dexon-cdfc03dc8e11a1738cad8009095549ea2d4b8287.tar.lz
dexon-cdfc03dc8e11a1738cad8009095549ea2d4b8287.tar.xz
dexon-cdfc03dc8e11a1738cad8009095549ea2d4b8287.tar.zst
dexon-cdfc03dc8e11a1738cad8009095549ea2d4b8287.zip
inline WhisperPost
Diffstat (limited to 'rpc/api.go')
-rw-r--r--rpc/api.go18
1 files changed, 7 insertions, 11 deletions
diff --git a/rpc/api.go b/rpc/api.go
index ded8b0296..961440493 100644
--- a/rpc/api.go
+++ b/rpc/api.go
@@ -331,16 +331,6 @@ func (self *EthereumApi) MessagesChanged(id int, reply *interface{}) error {
return nil
}
-func (p *EthereumApi) WhisperPost(args *WhisperMessageArgs, reply *interface{}) error {
- err := p.xeth().Whisper().Post(args.Payload, args.To, args.From, args.Topics, args.Priority, args.Ttl)
- if err != nil {
- return err
- }
-
- *reply = true
- return nil
-}
-
func (p *EthereumApi) GetBlockByHash(blockhash string, includetx bool) (*BlockRes, error) {
block := p.xeth().EthBlockByHash(blockhash)
br := NewBlockRes(block)
@@ -659,7 +649,13 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
if err := json.Unmarshal(req.Params, &args); err != nil {
return err
}
- return p.WhisperPost(args, reply)
+
+ err := p.xeth().Whisper().Post(args.Payload, args.To, args.From, args.Topics, args.Priority, args.Ttl)
+ if err != nil {
+ return err
+ }
+
+ *reply = true
case "shh_newIdentity":
*reply = p.xeth().Whisper().NewIdentity()
// case "shh_removeIdentity":