aboutsummaryrefslogtreecommitdiffstats
path: root/xeth/whisper.go
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2015-03-16 23:46:29 +0800
committerzelig <viktor.tron@gmail.com>2015-03-16 23:46:29 +0800
commit5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb (patch)
treed5ba6197a8c0c8e36bb92ee9fc8aad717cb2d178 /xeth/whisper.go
parent8393dab470c40678caf36ada82e312d29c4cf5c4 (diff)
parent22893b7ac925c49168c119f293ea8befc3aff5cc (diff)
downloaddexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar
dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar.gz
dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar.bz2
dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar.lz
dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar.xz
dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar.zst
dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.zip
Merge remote-tracking branch 'upstream/develop' into frontier/js
Conflicts: cmd/ethereum/js.go javascript/types.go
Diffstat (limited to 'xeth/whisper.go')
-rw-r--r--xeth/whisper.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/xeth/whisper.go b/xeth/whisper.go
index f5c26faae..76bf8012a 100644
--- a/xeth/whisper.go
+++ b/xeth/whisper.go
@@ -5,7 +5,7 @@ import (
"time"
"github.com/ethereum/go-ethereum/crypto"
- "github.com/ethereum/go-ethereum/ethutil"
+ "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/whisper"
)
@@ -29,12 +29,12 @@ func (self *Whisper) Post(payload string, to, from string, topics []string, prio
ttl = 100
}
- pk := crypto.ToECDSAPub(ethutil.FromHex(from))
+ pk := crypto.ToECDSAPub(common.FromHex(from))
if key := self.Whisper.GetIdentity(pk); key != nil || len(from) == 0 {
- msg := whisper.NewMessage(ethutil.FromHex(payload))
+ msg := whisper.NewMessage(common.FromHex(payload))
envelope, err := msg.Seal(time.Duration(priority*100000), whisper.Opts{
Ttl: time.Duration(ttl) * time.Second,
- To: crypto.ToECDSAPub(ethutil.FromHex(to)),
+ To: crypto.ToECDSAPub(common.FromHex(to)),
From: key,
Topics: whisper.TopicsFromString(topics...),
})
@@ -60,13 +60,13 @@ func (self *Whisper) NewIdentity() string {
}
func (self *Whisper) HasIdentity(key string) bool {
- return self.Whisper.HasIdentity(crypto.ToECDSAPub(ethutil.FromHex(key)))
+ return self.Whisper.HasIdentity(crypto.ToECDSAPub(common.FromHex(key)))
}
func (self *Whisper) Watch(opts *Options) int {
filter := whisper.Filter{
- To: crypto.ToECDSAPub(ethutil.FromHex(opts.To)),
- From: crypto.ToECDSAPub(ethutil.FromHex(opts.From)),
+ To: crypto.ToECDSAPub(common.FromHex(opts.To)),
+ From: crypto.ToECDSAPub(common.FromHex(opts.From)),
Topics: whisper.TopicsFromString(opts.Topics...),
}