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
4afc22ba
Commit
4afc22ba
authored
Apr 17, 2015
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
whisper: cleanup lefover scoping
parent
bd14bd6c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
topic.go
whisper/topic.go
+1
-1
topic_test.go
whisper/topic_test.go
+1
-1
whisper.go
whisper/whisper.go
+2
-2
No files found.
whisper/topic.go
View file @
4afc22ba
...
...
@@ -52,7 +52,7 @@ func (self *Topic) String() string {
type
topicSet
map
[
string
]
struct
{}
// NewTopicSet creates a topic hash set from a slice of topics.
func
N
ewTopicSet
(
topics
[]
Topic
)
topicSet
{
func
n
ewTopicSet
(
topics
[]
Topic
)
topicSet
{
set
:=
make
(
map
[
string
]
struct
{})
for
_
,
topic
:=
range
topics
{
set
[
topic
.
String
()]
=
struct
{}{}
...
...
whisper/topic_test.go
View file @
4afc22ba
...
...
@@ -57,7 +57,7 @@ func TestTopicSetCreation(t *testing.T) {
for
i
,
tt
:=
range
topicCreationTests
{
topics
[
i
]
=
NewTopic
(
tt
.
data
)
}
set
:=
N
ewTopicSet
(
topics
)
set
:=
n
ewTopicSet
(
topics
)
for
i
,
tt
:=
range
topicCreationTests
{
topic
:=
NewTopic
(
tt
.
data
)
if
_
,
ok
:=
set
[
topic
.
String
()];
!
ok
{
...
...
whisper/whisper.go
View file @
4afc22ba
...
...
@@ -119,7 +119,7 @@ func (self *Whisper) Watch(options Filter) int {
filter
:=
filter
.
Generic
{
Str1
:
string
(
crypto
.
FromECDSAPub
(
options
.
To
)),
Str2
:
string
(
crypto
.
FromECDSAPub
(
options
.
From
)),
Data
:
N
ewTopicSet
(
options
.
Topics
),
Data
:
n
ewTopicSet
(
options
.
Topics
),
Fn
:
func
(
data
interface
{})
{
options
.
Fn
(
data
.
(
*
Message
))
},
...
...
@@ -281,7 +281,7 @@ func createFilter(message *Message, topics []Topic) filter.Filter {
return
filter
.
Generic
{
Str1
:
string
(
crypto
.
FromECDSAPub
(
message
.
To
)),
Str2
:
string
(
crypto
.
FromECDSAPub
(
message
.
Recover
())),
Data
:
N
ewTopicSet
(
topics
),
Data
:
n
ewTopicSet
(
topics
),
}
}
...
...
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