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
95cca85d
Commit
95cca85d
authored
Mar 03, 2018
by
Vlad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
whisper: minor refactoring
parent
66cd41af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
main.go
cmd/wnode/main.go
+4
-8
No files found.
cmd/wnode/main.go
View file @
95cca85d
...
...
@@ -439,6 +439,8 @@ func run() {
}
else
{
sendLoop
()
}
close
(
done
)
}
func
sendLoop
()
{
...
...
@@ -446,11 +448,9 @@ func sendLoop() {
s
:=
scanLine
(
""
)
if
s
==
quitCommand
{
fmt
.
Println
(
"Quit command received"
)
close
(
done
)
break
return
}
sendMsg
([]
byte
(
s
))
if
*
asymmetricMode
{
// print your own message for convenience,
// because in asymmetric mode it is impossible to decrypt it
...
...
@@ -466,13 +466,11 @@ func sendFilesLoop() {
s
:=
scanLine
(
""
)
if
s
==
quitCommand
{
fmt
.
Println
(
"Quit command received"
)
close
(
done
)
break
return
}
b
,
err
:=
ioutil
.
ReadFile
(
s
)
if
err
!=
nil
{
fmt
.
Printf
(
">>> Error: %s
\n
"
,
err
)
continue
}
else
{
h
:=
sendMsg
(
b
)
if
(
h
==
common
.
Hash
{})
{
...
...
@@ -491,7 +489,6 @@ func fileReaderLoop() {
watcher2
:=
shh
.
GetFilter
(
asymFilterID
)
if
watcher1
==
nil
&&
watcher2
==
nil
{
fmt
.
Println
(
"Error: neither symmetric nor asymmetric filter is installed"
)
close
(
done
)
return
}
...
...
@@ -499,7 +496,6 @@ func fileReaderLoop() {
s
:=
scanLine
(
""
)
if
s
==
quitCommand
{
fmt
.
Println
(
"Quit command received"
)
close
(
done
)
return
}
raw
,
err
:=
ioutil
.
ReadFile
(
s
)
...
...
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