aboutsummaryrefslogtreecommitdiffstats
path: root/xeth
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-04 21:52:59 +0800
committerobscuren <geffobscura@gmail.com>2015-02-04 21:53:22 +0800
commitb1870631a4829e075eae77064973ef94aa2166b3 (patch)
tree1baf861b569d8310eb332238e5b771251141fd54 /xeth
parent4dc283c0fb5d886ce8d3638c3322af7e6f2a3b2e (diff)
downloaddexon-b1870631a4829e075eae77064973ef94aa2166b3.tar
dexon-b1870631a4829e075eae77064973ef94aa2166b3.tar.gz
dexon-b1870631a4829e075eae77064973ef94aa2166b3.tar.bz2
dexon-b1870631a4829e075eae77064973ef94aa2166b3.tar.lz
dexon-b1870631a4829e075eae77064973ef94aa2166b3.tar.xz
dexon-b1870631a4829e075eae77064973ef94aa2166b3.tar.zst
dexon-b1870631a4829e075eae77064973ef94aa2166b3.zip
WIP miner
Diffstat (limited to 'xeth')
-rw-r--r--xeth/whisper.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/xeth/whisper.go b/xeth/whisper.go
index 42d7c44bc..52f4593e4 100644
--- a/xeth/whisper.go
+++ b/xeth/whisper.go
@@ -2,11 +2,9 @@ package xeth
import (
"errors"
- "fmt"
"time"
"github.com/ethereum/go-ethereum/crypto"
- "github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/whisper"
)
@@ -32,7 +30,6 @@ func (self *Whisper) Post(payload string, to, from string, topics []string, prio
pk := crypto.ToECDSAPub(fromHex(from))
if key := self.Whisper.GetIdentity(pk); key != nil || len(from) == 0 {
- fmt.Println("POST:", to)
msg := whisper.NewMessage(fromHex(payload))
envelope, err := msg.Seal(time.Duration(priority*100000), whisper.Opts{
Ttl: time.Duration(ttl) * time.Second,
@@ -109,8 +106,8 @@ type WhisperMessage struct {
func NewWhisperMessage(msg *whisper.Message) WhisperMessage {
return WhisperMessage{
ref: msg,
- Payload: "0x" + ethutil.Bytes2Hex(msg.Payload),
- From: "0x" + ethutil.Bytes2Hex(crypto.FromECDSAPub(msg.Recover())),
+ Payload: toHex(msg.Payload),
+ From: toHex(crypto.FromECDSAPub(msg.Recover())),
Sent: msg.Sent,
}
}