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
61e6bb12
Unverified
Commit
61e6bb12
authored
Feb 22, 2017
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth, les, swarm: fix go vet issues sufraced by log15
parent
d4fd06c3
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
10 additions
and
10 deletions
+10
-10
downloader.go
eth/downloader/downloader.go
+1
-1
handler.go
les/handler.go
+1
-1
api.go
swarm/api/api.go
+1
-1
depo.go
swarm/network/depo.go
+1
-1
kaddb.go
swarm/network/kademlia/kaddb.go
+2
-2
syncdb.go
swarm/network/syncdb.go
+1
-1
syncer.go
swarm/network/syncer.go
+2
-2
swarm.go
swarm/swarm.go
+1
-1
No files found.
eth/downloader/downloader.go
View file @
61e6bb12
...
@@ -938,7 +938,7 @@ func (d *Downloader) fetchNodeData() error {
...
@@ -938,7 +938,7 @@ func (d *Downloader) fetchNodeData() error {
}
}
if
err
!=
nil
{
if
err
!=
nil
{
// If the node data processing failed, the root hash is very wrong, abort
// If the node data processing failed, the root hash is very wrong, abort
log
.
Error
(
fmt
.
Sprintf
(
"peer %
d
: state processing failed: %v"
,
packet
.
PeerId
(),
err
))
log
.
Error
(
fmt
.
Sprintf
(
"peer %
s
: state processing failed: %v"
,
packet
.
PeerId
(),
err
))
d
.
cancel
()
d
.
cancel
()
return
return
}
}
...
...
les/handler.go
View file @
61e6bb12
...
@@ -441,7 +441,7 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
...
@@ -441,7 +441,7 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
// Block header query, collect the requested headers and reply
// Block header query, collect the requested headers and reply
case
AnnounceMsg
:
case
AnnounceMsg
:
log
.
Debug
(
fmt
.
Sprint
(
"<=== AnnounceMsg from peer %v:"
,
p
.
id
))
log
.
Debug
(
fmt
.
Sprint
f
(
"<=== AnnounceMsg from peer %v:"
,
p
.
id
))
var
req
announceData
var
req
announceData
if
err
:=
msg
.
Decode
(
&
req
);
err
!=
nil
{
if
err
:=
msg
.
Decode
(
&
req
);
err
!=
nil
{
...
...
swarm/api/api.go
View file @
61e6bb12
...
@@ -84,7 +84,7 @@ func (self *Api) Resolve(hostPort string, nameresolver bool) (storage.Key, error
...
@@ -84,7 +84,7 @@ func (self *Api) Resolve(hostPort string, nameresolver bool) (storage.Key, error
err
=
ErrResolve
(
err
)
err
=
ErrResolve
(
err
)
log
.
Warn
(
fmt
.
Sprintf
(
"DNS error : %v"
,
err
))
log
.
Warn
(
fmt
.
Sprintf
(
"DNS error : %v"
,
err
))
}
}
log
.
Trace
(
fmt
.
Sprintf
(
"host lookup: %v -> %v"
,
err
))
log
.
Trace
(
fmt
.
Sprintf
(
"host lookup: %v -> %v"
,
hostPort
,
contentHash
))
return
contentHash
[
:
],
err
return
contentHash
[
:
],
err
}
}
func
Parse
(
uri
string
)
(
hostPort
,
path
string
)
{
func
Parse
(
uri
string
)
(
hostPort
,
path
string
)
{
...
...
swarm/network/depo.go
View file @
61e6bb12
...
@@ -211,7 +211,7 @@ only add if less than requesterCount peers forwarded the same request id so far
...
@@ -211,7 +211,7 @@ only add if less than requesterCount peers forwarded the same request id so far
note this is done irrespective of status (searching or found)
note this is done irrespective of status (searching or found)
*/
*/
func
(
self
*
Depo
)
addRequester
(
rs
*
storage
.
RequestStatus
,
req
*
retrieveRequestMsgData
)
{
func
(
self
*
Depo
)
addRequester
(
rs
*
storage
.
RequestStatus
,
req
*
retrieveRequestMsgData
)
{
log
.
Trace
(
fmt
.
Sprintf
(
"Depo.addRequester: key %v - add peer to req.Id %v"
,
req
.
Key
.
Log
(),
req
.
from
,
req
.
Id
))
log
.
Trace
(
fmt
.
Sprintf
(
"Depo.addRequester: key %v - add peer to req.Id %v"
,
req
.
Key
.
Log
(),
req
.
Id
))
list
:=
rs
.
Requesters
[
req
.
Id
]
list
:=
rs
.
Requesters
[
req
.
Id
]
rs
.
Requesters
[
req
.
Id
]
=
append
(
list
,
req
)
rs
.
Requesters
[
req
.
Id
]
=
append
(
list
,
req
)
}
}
swarm/network/kademlia/kaddb.go
View file @
61e6bb12
...
@@ -120,7 +120,7 @@ func (self *KadDb) add(nrs []*NodeRecord, proximityBin func(Address) int) {
...
@@ -120,7 +120,7 @@ func (self *KadDb) add(nrs []*NodeRecord, proximityBin func(Address) int) {
copy
(
newnodes
[
:
],
nodes
[
:
dbcursor
])
copy
(
newnodes
[
:
],
nodes
[
:
dbcursor
])
newnodes
[
dbcursor
]
=
node
newnodes
[
dbcursor
]
=
node
copy
(
newnodes
[
dbcursor
+
1
:
],
nodes
[
dbcursor
:
])
copy
(
newnodes
[
dbcursor
+
1
:
],
nodes
[
dbcursor
:
])
log
.
Trace
(
fmt
.
Sprintf
(
"new nodes: %v
(keys: %v)
\n
nodes: %v"
,
newnodes
,
nodes
))
log
.
Trace
(
fmt
.
Sprintf
(
"new nodes: %v
,
nodes: %v"
,
newnodes
,
nodes
))
self
.
Nodes
[
index
]
=
newnodes
self
.
Nodes
[
index
]
=
newnodes
n
++
n
++
}
}
...
@@ -294,7 +294,7 @@ func (self *KadDb) save(path string, cb func(*NodeRecord, Node)) error {
...
@@ -294,7 +294,7 @@ func (self *KadDb) save(path string, cb func(*NodeRecord, Node)) error {
}
}
err
=
ioutil
.
WriteFile
(
path
,
data
,
os
.
ModePerm
)
err
=
ioutil
.
WriteFile
(
path
,
data
,
os
.
ModePerm
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Warn
(
fmt
.
Sprintf
(
"unable to save kaddb with %v nodes to %v:
err
"
,
n
,
path
,
err
))
log
.
Warn
(
fmt
.
Sprintf
(
"unable to save kaddb with %v nodes to %v:
%v
"
,
n
,
path
,
err
))
}
else
{
}
else
{
log
.
Info
(
fmt
.
Sprintf
(
"saved kaddb with %v nodes to %v"
,
n
,
path
))
log
.
Info
(
fmt
.
Sprintf
(
"saved kaddb with %v nodes to %v"
,
n
,
path
))
}
}
...
...
swarm/network/syncdb.go
View file @
61e6bb12
...
@@ -217,7 +217,7 @@ LOOP:
...
@@ -217,7 +217,7 @@ LOOP:
// if just switched to db mode and not quitting, then launch dbRead
// if just switched to db mode and not quitting, then launch dbRead
// in a parallel go routine to send deliveries from db
// in a parallel go routine to send deliveries from db
if
inDb
==
0
&&
quit
!=
nil
{
if
inDb
==
0
&&
quit
!=
nil
{
log
.
Trace
(
fmt
.
Sprintf
(
"syncDb[%v/%v] start dbRead"
))
log
.
Trace
(
fmt
.
Sprintf
(
"syncDb[%v/%v] start dbRead"
,
self
.
key
.
Log
(),
self
.
priority
))
go
self
.
dbRead
(
true
,
counter
,
deliver
)
go
self
.
dbRead
(
true
,
counter
,
deliver
)
}
}
inDb
++
inDb
++
...
...
swarm/network/syncer.go
View file @
61e6bb12
...
@@ -480,7 +480,7 @@ LOOP:
...
@@ -480,7 +480,7 @@ LOOP:
stateCopy
:=
*
state
stateCopy
:=
*
state
err
:=
self
.
unsyncedKeys
(
unsynced
,
&
stateCopy
)
err
:=
self
.
unsyncedKeys
(
unsynced
,
&
stateCopy
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Warn
(
fmt
.
Sprintf
(
"syncer[%v]: unable to send unsynced keys: %v"
,
err
))
log
.
Warn
(
fmt
.
Sprintf
(
"syncer[%v]: unable to send unsynced keys: %v"
,
self
.
key
.
Log
(),
err
))
}
}
self
.
state
=
state
self
.
state
=
state
log
.
Debug
(
fmt
.
Sprintf
(
"syncer[%v]: --> %v keys sent: (total: %v (%v), history: %v), sent sync state: %v"
,
self
.
key
.
Log
(),
len
(
unsynced
),
keyCounts
,
keyCount
,
historyCnt
,
stateCopy
))
log
.
Debug
(
fmt
.
Sprintf
(
"syncer[%v]: --> %v keys sent: (total: %v (%v), history: %v), sent sync state: %v"
,
self
.
key
.
Log
(),
len
(
unsynced
),
keyCounts
,
keyCount
,
historyCnt
,
stateCopy
))
...
@@ -553,7 +553,7 @@ LOOP:
...
@@ -553,7 +553,7 @@ LOOP:
log
.
Trace
(
fmt
.
Sprintf
(
"syncer[%v]: (priority %v): request %v (synced = %v)"
,
self
.
key
.
Log
(),
priority
,
req
,
state
.
Synced
))
log
.
Trace
(
fmt
.
Sprintf
(
"syncer[%v]: (priority %v): request %v (synced = %v)"
,
self
.
key
.
Log
(),
priority
,
req
,
state
.
Synced
))
unsynced
=
append
(
unsynced
,
sreq
)
unsynced
=
append
(
unsynced
,
sreq
)
}
else
{
}
else
{
log
.
Warn
(
fmt
.
Sprintf
(
"syncer[%v]: (priority %v): error creating request for %v: %v)"
,
self
.
key
.
Log
(),
priority
,
req
,
state
.
Synced
,
err
))
log
.
Warn
(
fmt
.
Sprintf
(
"syncer[%v]: (priority %v): error creating request for %v: %v)"
,
self
.
key
.
Log
(),
priority
,
req
,
err
))
}
}
}
}
...
...
swarm/swarm.go
View file @
61e6bb12
...
@@ -197,7 +197,7 @@ func (self *Swarm) Start(net *p2p.Server) error {
...
@@ -197,7 +197,7 @@ func (self *Swarm) Start(net *p2p.Server) error {
log
.
Debug
(
fmt
.
Sprintf
(
"Swarm http proxy started on port: %v"
,
self
.
config
.
Port
))
log
.
Debug
(
fmt
.
Sprintf
(
"Swarm http proxy started on port: %v"
,
self
.
config
.
Port
))
if
self
.
corsString
!=
""
{
if
self
.
corsString
!=
""
{
log
.
Debug
(
fmt
.
Sprintf
(
"Swarm http proxy started with corsdomain:"
,
self
.
corsString
))
log
.
Debug
(
fmt
.
Sprintf
(
"Swarm http proxy started with corsdomain:
%v
"
,
self
.
corsString
))
}
}
return
nil
return
nil
...
...
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