Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
ddccea75
Commit
ddccea75
authored
Feb 10, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed "to" field
parent
58ba290a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletion
+7
-1
message.go
whisper/message.go
+2
-0
whisper.go
whisper/whisper.go
+2
-0
whisper.go
xeth/whisper.go
+3
-1
No files found.
whisper/message.go
View file @
ddccea75
...
...
@@ -12,6 +12,8 @@ type Message struct {
Signature
[]
byte
Payload
[]
byte
Sent
int64
To
*
ecdsa
.
PublicKey
}
func
NewMessage
(
payload
[]
byte
)
*
Message
{
...
...
whisper/whisper.go
View file @
ddccea75
...
...
@@ -256,6 +256,8 @@ func (self *Whisper) postEvent(envelope *Envelope) {
func
(
self
*
Whisper
)
open
(
envelope
*
Envelope
)
(
*
Message
,
*
ecdsa
.
PrivateKey
)
{
for
_
,
key
:=
range
self
.
keys
{
if
message
,
err
:=
envelope
.
Open
(
key
);
err
==
nil
||
(
err
!=
nil
&&
err
==
ecies
.
ErrInvalidPublicKey
)
{
message
.
To
=
&
key
.
PublicKey
return
message
,
key
}
}
...
...
xeth/whisper.go
View file @
ddccea75
...
...
@@ -99,8 +99,9 @@ type Options struct {
type
WhisperMessage
struct
{
ref
*
whisper
.
Message
Payload
string
`json:"payload"`
To
string
`json:"to"`
From
string
`json:"from"`
Sent
int64
`json:"
time
"`
Sent
int64
`json:"
sent
"`
}
func
NewWhisperMessage
(
msg
*
whisper
.
Message
)
WhisperMessage
{
...
...
@@ -108,6 +109,7 @@ func NewWhisperMessage(msg *whisper.Message) WhisperMessage {
ref
:
msg
,
Payload
:
toHex
(
msg
.
Payload
),
From
:
toHex
(
crypto
.
FromECDSAPub
(
msg
.
Recover
())),
To
:
toHex
(
crypto
.
FromECDSAPub
(
msg
.
To
)),
Sent
:
msg
.
Sent
,
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment