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
3da1bf8c
Commit
3da1bf8c
authored
Dec 12, 2017
by
Zach
Committed by
Felix Lange
Dec 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all: use gometalinter.v2, fix new gosimple issues (#15650)
parent
bbea4b2b
Changes
24
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
57 additions
and
67 deletions
+57
-67
bind.go
accounts/abi/bind/bind.go
+1
-1
unpack_test.go
accounts/abi/unpack_test.go
+2
-2
bmt.go
bmt/bmt.go
+1
-2
ci.go
build/ci.go
+4
-4
faucet.go
cmd/faucet/faucet.go
+1
-1
module_dashboard.go
cmd/puppeth/module_dashboard.go
+1
-0
config.go
cmd/swarm/config.go
+1
-1
config_test.go
cmd/swarm/config_test.go
+4
-4
clique.go
consensus/clique/clique.go
+1
-1
console_test.go
console/console_test.go
+7
-7
asm.go
core/asm/asm.go
+1
-4
compiler.go
core/asm/compiler.go
+1
-4
genesis_alloc.go
core/genesis_alloc.go
+1
-0
ethstats.go
ethstats/ethstats.go
+0
-1
net.go
p2p/discv5/net.go
+1
-1
ntp.go
p2p/discv5/ntp.go
+4
-4
ticket.go
p2p/discv5/ticket.go
+6
-6
network.go
p2p/simulations/network.go
+3
-4
http_test.go
rpc/http_test.go
+1
-1
config_test.go
swarm/api/config_test.go
+1
-1
swarmfs_test.go
swarm/fuse/swarmfs_test.go
+4
-6
chunker_test.go
swarm/storage/chunker_test.go
+2
-2
pyramid.go
swarm/storage/pyramid.go
+8
-8
whisper_test.go
whisper/whisperv6/whisper_test.go
+1
-2
No files found.
accounts/abi/bind/bind.go
View file @
3da1bf8c
...
...
@@ -129,7 +129,7 @@ func Bind(types []string, abis []string, bytecodes []string, pkg string, lang La
return
string
(
code
),
nil
}
// For all others just return as is for now
return
string
(
buffer
.
Bytes
()
),
nil
return
buffer
.
String
(
),
nil
}
// bindType is a set of type binders that convert Solidity types to some supported
...
...
accounts/abi/unpack_test.go
View file @
3da1bf8c
...
...
@@ -368,11 +368,11 @@ func TestUnmarshal(t *testing.T) {
if
err
!=
nil
{
t
.
Error
(
err
)
}
else
{
if
bytes
.
Compare
(
p0
,
p0Exp
)
!=
0
{
if
!
bytes
.
Equal
(
p0
,
p0Exp
)
{
t
.
Errorf
(
"unexpected value unpacked: want %x, got %x"
,
p0Exp
,
p0
)
}
if
bytes
.
Compare
(
p1
[
:
],
p1Exp
)
!=
0
{
if
!
bytes
.
Equal
(
p1
[
:
],
p1Exp
)
{
t
.
Errorf
(
"unexpected value unpacked: want %x, got %x"
,
p1Exp
,
p1
)
}
}
...
...
bmt/bmt.go
View file @
3da1bf8c
...
...
@@ -260,8 +260,7 @@ func NewTree(hasher BaseHasher, segmentSize, segmentCount int) *Tree {
for
d
:=
1
;
d
<=
depth
(
segmentCount
);
d
++
{
nodes
:=
make
([]
*
Node
,
count
)
for
i
:=
0
;
i
<
len
(
nodes
);
i
++
{
var
parent
*
Node
parent
=
prevlevel
[
i
/
2
]
parent
:=
prevlevel
[
i
/
2
]
t
:=
NewNode
(
level
,
i
,
parent
)
nodes
[
i
]
=
t
}
...
...
build/ci.go
View file @
3da1bf8c
...
...
@@ -319,8 +319,8 @@ func doLint(cmdline []string) {
packages
=
flag
.
CommandLine
.
Args
()
}
// Get metalinter and install all supported linters
build
.
MustRun
(
goTool
(
"get"
,
"gopkg.in/alecthomas/gometalinter.v
1
"
))
build
.
MustRunCommand
(
filepath
.
Join
(
GOBIN
,
"gometalinter.v
1
"
),
"--install"
)
build
.
MustRun
(
goTool
(
"get"
,
"gopkg.in/alecthomas/gometalinter.v
2
"
))
build
.
MustRunCommand
(
filepath
.
Join
(
GOBIN
,
"gometalinter.v
2
"
),
"--install"
)
// Run fast linters batched together
configs
:=
[]
string
{
...
...
@@ -332,12 +332,12 @@ func doLint(cmdline []string) {
"--enable=goconst"
,
"--min-occurrences=6"
,
// for goconst
}
build
.
MustRunCommand
(
filepath
.
Join
(
GOBIN
,
"gometalinter.v
1
"
),
append
(
configs
,
packages
...
)
...
)
build
.
MustRunCommand
(
filepath
.
Join
(
GOBIN
,
"gometalinter.v
2
"
),
append
(
configs
,
packages
...
)
...
)
// Run slow linters one by one
for
_
,
linter
:=
range
[]
string
{
"unconvert"
,
"gosimple"
}
{
configs
=
[]
string
{
"--vendor"
,
"--deadline=10m"
,
"--disable-all"
,
"--enable="
+
linter
}
build
.
MustRunCommand
(
filepath
.
Join
(
GOBIN
,
"gometalinter.v
1
"
),
append
(
configs
,
packages
...
)
...
)
build
.
MustRunCommand
(
filepath
.
Join
(
GOBIN
,
"gometalinter.v
2
"
),
append
(
configs
,
packages
...
)
...
)
}
}
...
...
cmd/faucet/faucet.go
View file @
3da1bf8c
...
...
@@ -506,7 +506,7 @@ func (f *faucet) apiHandler(conn *websocket.Conn) {
// Send an error if too frequent funding, othewise a success
if
!
fund
{
if
err
=
sendError
(
conn
,
fmt
.
Errorf
(
"%s left until next allowance"
,
common
.
PrettyDuration
(
timeout
.
Sub
(
time
.
Now
()))));
err
!=
nil
{
if
err
=
sendError
(
conn
,
fmt
.
Errorf
(
"%s left until next allowance"
,
common
.
PrettyDuration
(
timeout
.
Sub
(
time
.
Now
()))));
err
!=
nil
{
// nolint: gosimple
log
.
Warn
(
"Failed to send funding error to client"
,
"err"
,
err
)
return
}
...
...
cmd/puppeth/module_dashboard.go
View file @
3da1bf8c
This source diff could not be displayed because it is too large. You can
view the blob
instead.
cmd/swarm/config.go
View file @
3da1bf8c
...
...
@@ -267,7 +267,7 @@ func envVarsOverride(currentConfig *bzzapi.Config) (config *bzzapi.Config) {
}
//EnsApi can be set to "", so can't check for empty string, as it is allowed
if
ensapi
,
exists
:=
os
.
LookupEnv
(
SWARM_ENV_ENS_API
);
exists
==
true
{
if
ensapi
,
exists
:=
os
.
LookupEnv
(
SWARM_ENV_ENS_API
);
exists
{
currentConfig
.
EnsApi
=
ensapi
}
...
...
cmd/swarm/config_test.go
View file @
3da1bf8c
...
...
@@ -124,7 +124,7 @@ func TestCmdLineOverrides(t *testing.T) {
t
.
Fatalf
(
"Expected network ID to be %d, got %d"
,
42
,
info
.
NetworkId
)
}
if
info
.
SyncEnabled
!=
true
{
if
!
info
.
SyncEnabled
{
t
.
Fatal
(
"Expected Sync to be enabled, but is false"
)
}
...
...
@@ -219,7 +219,7 @@ func TestFileOverrides(t *testing.T) {
t
.
Fatalf
(
"Expected network ID to be %d, got %d"
,
54
,
info
.
NetworkId
)
}
if
info
.
SyncEnabled
!=
true
{
if
!
info
.
SyncEnabled
{
t
.
Fatal
(
"Expected Sync to be enabled, but is false"
)
}
...
...
@@ -334,7 +334,7 @@ func TestEnvVars(t *testing.T) {
t
.
Fatalf
(
"Expected Cors flag to be set to %s, got %s"
,
"*"
,
info
.
Cors
)
}
if
info
.
SyncEnabled
!=
true
{
if
!
info
.
SyncEnabled
{
t
.
Fatal
(
"Expected Sync to be enabled, but is false"
)
}
...
...
@@ -431,7 +431,7 @@ func TestCmdLineOverridesFile(t *testing.T) {
t
.
Fatalf
(
"Expected network ID to be %d, got %d"
,
expectNetworkId
,
info
.
NetworkId
)
}
if
info
.
SyncEnabled
!=
true
{
if
!
info
.
SyncEnabled
{
t
.
Fatal
(
"Expected Sync to be enabled, but is false"
)
}
...
...
consensus/clique/clique.go
View file @
3da1bf8c
...
...
@@ -630,7 +630,7 @@ func (c *Clique) Seal(chain consensus.ChainReader, block *types.Block, stop <-ch
}
}
// Sweet, the protocol permits us to sign the block, wait for our time
delay
:=
time
.
Unix
(
header
.
Time
.
Int64
(),
0
)
.
Sub
(
time
.
Now
())
delay
:=
time
.
Unix
(
header
.
Time
.
Int64
(),
0
)
.
Sub
(
time
.
Now
())
// nolint: gosimple
if
header
.
Difficulty
.
Cmp
(
diffNoTurn
)
==
0
{
// It's not our turn explicitly to sign, delay it a bit
wiggle
:=
time
.
Duration
(
len
(
snap
.
Signers
)
/
2
+
1
)
*
wiggleTime
...
...
console/console_test.go
View file @
3da1bf8c
...
...
@@ -164,7 +164,7 @@ func TestWelcome(t *testing.T) {
tester
.
console
.
Welcome
()
output
:=
string
(
tester
.
output
.
Bytes
()
)
output
:=
tester
.
output
.
String
(
)
if
want
:=
"Welcome"
;
!
strings
.
Contains
(
output
,
want
)
{
t
.
Fatalf
(
"console output missing welcome message: have
\n
%s
\n
want also %s"
,
output
,
want
)
}
...
...
@@ -188,7 +188,7 @@ func TestEvaluate(t *testing.T) {
defer
tester
.
Close
(
t
)
tester
.
console
.
Evaluate
(
"2 + 2"
)
if
output
:=
string
(
tester
.
output
.
Bytes
()
);
!
strings
.
Contains
(
output
,
"4"
)
{
if
output
:=
tester
.
output
.
String
(
);
!
strings
.
Contains
(
output
,
"4"
)
{
t
.
Fatalf
(
"statement evaluation failed: have %s, want %s"
,
output
,
"4"
)
}
}
...
...
@@ -218,7 +218,7 @@ func TestInteractive(t *testing.T) {
case
<-
time
.
After
(
time
.
Second
)
:
t
.
Fatalf
(
"secondary prompt timeout"
)
}
if
output
:=
string
(
tester
.
output
.
Bytes
()
);
!
strings
.
Contains
(
output
,
"4"
)
{
if
output
:=
tester
.
output
.
String
(
);
!
strings
.
Contains
(
output
,
"4"
)
{
t
.
Fatalf
(
"statement evaluation failed: have %s, want %s"
,
output
,
"4"
)
}
}
...
...
@@ -230,7 +230,7 @@ func TestPreload(t *testing.T) {
defer
tester
.
Close
(
t
)
tester
.
console
.
Evaluate
(
"preloaded"
)
if
output
:=
string
(
tester
.
output
.
Bytes
()
);
!
strings
.
Contains
(
output
,
"some-preloaded-string"
)
{
if
output
:=
tester
.
output
.
String
(
);
!
strings
.
Contains
(
output
,
"some-preloaded-string"
)
{
t
.
Fatalf
(
"preloaded variable missing: have %s, want %s"
,
output
,
"some-preloaded-string"
)
}
}
...
...
@@ -243,7 +243,7 @@ func TestExecute(t *testing.T) {
tester
.
console
.
Execute
(
"exec.js"
)
tester
.
console
.
Evaluate
(
"execed"
)
if
output
:=
string
(
tester
.
output
.
Bytes
()
);
!
strings
.
Contains
(
output
,
"some-executed-string"
)
{
if
output
:=
tester
.
output
.
String
(
);
!
strings
.
Contains
(
output
,
"some-executed-string"
)
{
t
.
Fatalf
(
"execed variable missing: have %s, want %s"
,
output
,
"some-executed-string"
)
}
}
...
...
@@ -275,7 +275,7 @@ func TestPrettyPrint(t *testing.T) {
string: `
+
two
+
`
}
`
if
output
:=
string
(
tester
.
output
.
Bytes
()
);
output
!=
want
{
if
output
:=
tester
.
output
.
String
(
);
output
!=
want
{
t
.
Fatalf
(
"pretty print mismatch: have %s, want %s"
,
output
,
want
)
}
}
...
...
@@ -287,7 +287,7 @@ func TestPrettyError(t *testing.T) {
tester
.
console
.
Evaluate
(
"throw 'hello'"
)
want
:=
jsre
.
ErrorColor
(
"hello"
)
+
"
\n
"
if
output
:=
string
(
tester
.
output
.
Bytes
()
);
output
!=
want
{
if
output
:=
tester
.
output
.
String
(
);
output
!=
want
{
t
.
Fatalf
(
"pretty error mismatch: have %s, want %s"
,
output
,
want
)
}
}
...
...
core/asm/asm.go
View file @
3da1bf8c
...
...
@@ -114,10 +114,7 @@ func PrintDisassembled(code string) error {
fmt
.
Printf
(
"%06v: %v
\n
"
,
it
.
PC
(),
it
.
Op
())
}
}
if
err
:=
it
.
Error
();
err
!=
nil
{
return
err
}
return
nil
return
it
.
Error
()
}
// Return all disassembled EVM instructions in human-readable format.
...
...
core/asm/compiler.go
View file @
3da1bf8c
...
...
@@ -237,10 +237,7 @@ func (c *Compiler) pushBin(v interface{}) {
// isPush returns whether the string op is either any of
// push(N).
func
isPush
(
op
string
)
bool
{
if
op
==
"push"
{
return
true
}
return
false
return
op
==
"push"
}
// isJump returns whether the string op is jump(i)
...
...
core/genesis_alloc.go
View file @
3da1bf8c
This diff is collapsed.
Click to expand it.
ethstats/ethstats.go
View file @
3da1bf8c
...
...
@@ -193,7 +193,6 @@ func (s *Service) loop() {
}
}
close
(
quitCh
)
return
}()
// Loop reporting until termination
for
{
...
...
p2p/discv5/net.go
View file @
3da1bf8c
...
...
@@ -684,7 +684,7 @@ func (net *Network) refresh(done chan<- struct{}) {
seeds
=
net
.
nursery
}
if
len
(
seeds
)
==
0
{
log
.
Trace
(
fmt
.
Sprint
(
"no seed nodes found"
)
)
log
.
Trace
(
"no seed nodes found"
)
close
(
done
)
return
}
...
...
p2p/discv5/ntp.go
View file @
3da1bf8c
...
...
@@ -54,10 +54,10 @@ func checkClockDrift() {
howtofix
:=
fmt
.
Sprintf
(
"Please enable network time synchronisation in system settings"
)
separator
:=
strings
.
Repeat
(
"-"
,
len
(
warning
))
log
.
Warn
(
fmt
.
Sprint
(
separator
)
)
log
.
Warn
(
fmt
.
Sprint
(
warning
)
)
log
.
Warn
(
fmt
.
Sprint
(
howtofix
)
)
log
.
Warn
(
fmt
.
Sprint
(
separator
)
)
log
.
Warn
(
separator
)
log
.
Warn
(
warning
)
log
.
Warn
(
howtofix
)
log
.
Warn
(
separator
)
}
else
{
log
.
Debug
(
fmt
.
Sprintf
(
"Sanity NTP check reported %v drift, all ok"
,
drift
))
}
...
...
p2p/discv5/ticket.go
View file @
3da1bf8c
...
...
@@ -398,12 +398,12 @@ func (s *ticketStore) nextRegisterableTicket() (t *ticketRef, wait time.Duration
//s.removeExcessTickets(topic)
if
len
(
tickets
.
buckets
)
!=
0
{
empty
=
false
if
list
:=
tickets
.
buckets
[
bucket
];
list
!=
nil
{
for
_
,
ref
:=
range
list
{
//debugLog(fmt.Sprintf(" nrt bucket = %d node = %x sn = %v wait = %v", bucket, ref.t.node.ID[:8], ref.t.serial, time.Duration(ref.topicRegTime()-now)))
if
nextTicket
.
t
==
nil
||
ref
.
topicRegTime
()
<
nextTicket
.
topicRegTime
()
{
nextTicket
=
ref
}
list
:=
tickets
.
buckets
[
bucket
]
for
_
,
ref
:=
range
list
{
//debugLog(fmt.Sprintf(" nrt bucket = %d node = %x sn = %v wait = %v", bucket, ref.t.node.ID[:8], ref.t.serial, time.Duration(ref.topicRegTime()-now)))
if
nextTicket
.
t
==
nil
||
ref
.
topicRegTime
()
<
nextTicket
.
topicRegTime
()
{
nextTicket
=
ref
}
}
}
...
...
p2p/simulations/network.go
View file @
3da1bf8c
...
...
@@ -403,9 +403,8 @@ func (self *Network) getNodeByName(name string) *Node {
func
(
self
*
Network
)
GetNodes
()
(
nodes
[]
*
Node
)
{
self
.
lock
.
Lock
()
defer
self
.
lock
.
Unlock
()
for
_
,
node
:=
range
self
.
Nodes
{
nodes
=
append
(
nodes
,
node
)
}
nodes
=
append
(
nodes
,
self
.
Nodes
...
)
return
nodes
}
...
...
@@ -477,7 +476,7 @@ func (self *Network) InitConn(oneID, otherID discover.NodeID) (*Conn, error) {
if
err
!=
nil
{
return
nil
,
err
}
if
time
.
Now
()
.
Sub
(
conn
.
initiated
)
<
dialBanTimeout
{
if
time
.
Since
(
conn
.
initiated
)
<
dialBanTimeout
{
return
nil
,
fmt
.
Errorf
(
"connection between %v and %v recently attempted"
,
oneID
,
otherID
)
}
if
conn
.
Up
{
...
...
rpc/http_test.go
View file @
3da1bf8c
...
...
@@ -32,7 +32,7 @@ func TestHTTPErrorResponseWithPut(t *testing.T) {
}
func
TestHTTPErrorResponseWithMaxContentLength
(
t
*
testing
.
T
)
{
body
:=
make
([]
rune
,
maxHTTPRequestContentLength
+
1
,
maxHTTPRequestContentLength
+
1
)
body
:=
make
([]
rune
,
maxHTTPRequestContentLength
+
1
)
testHTTPErrorResponse
(
t
,
"POST"
,
contentType
,
string
(
body
),
http
.
StatusRequestEntityTooLarge
)
}
...
...
swarm/api/config_test.go
View file @
3da1bf8c
...
...
@@ -36,7 +36,7 @@ func TestConfig(t *testing.T) {
one
:=
NewDefaultConfig
()
two
:=
NewDefaultConfig
()
if
equal
:=
reflect
.
DeepEqual
(
one
,
two
);
equal
==
false
{
if
equal
:=
reflect
.
DeepEqual
(
one
,
two
);
!
equal
{
t
.
Fatal
(
"Two default configs are not equal"
)
}
...
...
swarm/fuse/swarmfs_test.go
View file @
3da1bf8c
...
...
@@ -95,7 +95,7 @@ func mountDir(t *testing.T, api *api.Api, files map[string]fileInfo, bzzHash str
}
// Test listMounts
if
found
==
false
{
if
!
found
{
t
.
Fatalf
(
"Error getting mounts information for %v: %v"
,
mountDir
,
err
)
}
...
...
@@ -185,10 +185,8 @@ func isDirEmpty(name string) bool {
defer
f
.
Close
()
_
,
err
=
f
.
Readdirnames
(
1
)
if
err
==
io
.
EOF
{
return
true
}
return
false
return
err
==
io
.
EOF
}
type
testAPI
struct
{
...
...
@@ -388,7 +386,7 @@ func (ta *testAPI) seekInMultiChunkFile(t *testing.T) {
d
.
Read
(
contents
)
finfo
:=
files
[
"1.txt"
]
if
bytes
.
Compare
(
finfo
.
contents
[
:
6024
][
5000
:
],
contents
)
!=
0
{
if
!
bytes
.
Equal
(
finfo
.
contents
[
:
6024
][
5000
:
],
contents
)
{
t
.
Fatalf
(
"File seek contents mismatch"
)
}
d
.
Close
()
...
...
swarm/storage/chunker_test.go
View file @
3da1bf8c
...
...
@@ -77,7 +77,7 @@ func (self *chunkerTester) Split(chunker Splitter, data io.Reader, size int64, c
key
,
err
=
chunker
.
Split
(
data
,
size
,
chunkC
,
swg
,
nil
)
if
err
!=
nil
&&
expectedError
==
nil
{
err
=
errors
.
New
(
fmt
.
Sprintf
(
"Split error: %v"
,
err
)
)
err
=
fmt
.
Errorf
(
"Split error: %v"
,
err
)
}
if
chunkC
!=
nil
{
...
...
@@ -123,7 +123,7 @@ func (self *chunkerTester) Append(chunker Splitter, rootKey Key, data io.Reader,
key
,
err
=
chunker
.
Append
(
rootKey
,
data
,
chunkC
,
swg
,
nil
)
if
err
!=
nil
&&
expectedError
==
nil
{
err
=
errors
.
New
(
fmt
.
Sprintf
(
"Append error: %v"
,
err
)
)
err
=
fmt
.
Errorf
(
"Append error: %v"
,
err
)
}
if
chunkC
!=
nil
{
...
...
swarm/storage/pyramid.go
View file @
3da1bf8c
...
...
@@ -391,7 +391,7 @@ func (self *PyramidChunker) prepareChunks(isAppend bool, chunkLevel [][]*TreeEnt
parent
:=
NewTreeEntry
(
self
)
var
unFinishedChunk
*
Chunk
if
isAppend
==
true
&&
len
(
chunkLevel
[
0
])
!=
0
{
if
isAppend
&&
len
(
chunkLevel
[
0
])
!=
0
{
lastIndex
:=
len
(
chunkLevel
[
0
])
-
1
ent
:=
chunkLevel
[
0
][
lastIndex
]
...
...
@@ -512,7 +512,7 @@ func (self *PyramidChunker) buildTree(isAppend bool, chunkLevel [][]*TreeEntry,
}
}
if
compress
==
false
&&
last
==
false
{
if
!
compress
&&
!
last
{
return
}
...
...
@@ -522,7 +522,7 @@ func (self *PyramidChunker) buildTree(isAppend bool, chunkLevel [][]*TreeEntry,
for
lvl
:=
int64
(
ent
.
level
);
lvl
<
endLvl
;
lvl
++
{
lvlCount
:=
int64
(
len
(
chunkLevel
[
lvl
]))
if
lvlCount
==
1
&&
last
==
true
{
if
lvlCount
==
1
&&
last
{
copy
(
rootKey
,
chunkLevel
[
lvl
][
0
]
.
key
)
return
}
...
...
@@ -540,7 +540,7 @@ func (self *PyramidChunker) buildTree(isAppend bool, chunkLevel [][]*TreeEntry,
nextLvlCount
=
int64
(
len
(
chunkLevel
[
lvl
+
1
])
-
1
)
tempEntry
=
chunkLevel
[
lvl
+
1
][
nextLvlCount
]
}
if
isAppend
==
true
&&
tempEntry
!=
nil
&&
tempEntry
.
updatePending
==
true
{
if
isAppend
&&
tempEntry
!=
nil
&&
tempEntry
.
updatePending
{
updateEntry
:=
&
TreeEntry
{
level
:
int
(
lvl
+
1
),
branchCount
:
0
,
...
...
@@ -585,9 +585,9 @@ func (self *PyramidChunker) buildTree(isAppend bool, chunkLevel [][]*TreeEntry,
}
if
isAppend
==
false
{
if
!
isAppend
{
chunkWG
.
Wait
()
if
compress
==
true
{
if
compress
{
chunkLevel
[
lvl
]
=
nil
}
}
...
...
@@ -599,7 +599,7 @@ func (self *PyramidChunker) enqueueTreeChunk(chunkLevel [][]*TreeEntry, ent *Tre
if
ent
!=
nil
{
// wait for data chunks to get over before processing the tree chunk
if
last
==
true
{
if
last
{
chunkWG
.
Wait
()
}
...
...
@@ -612,7 +612,7 @@ func (self *PyramidChunker) enqueueTreeChunk(chunkLevel [][]*TreeEntry, ent *Tre
}
// Update or append based on weather it is a new entry or being reused
if
ent
.
updatePending
==
true
{
if
ent
.
updatePending
{
chunkWG
.
Wait
()
chunkLevel
[
ent
.
level
][
ent
.
index
]
=
ent
}
else
{
...
...
whisper/whisperv6/whisper_test.go
View file @
3da1bf8c
...
...
@@ -80,8 +80,7 @@ func TestWhisperBasic(t *testing.T) {
t
.
Fatalf
(
"failed w.Messages."
)
}
var
derived
[]
byte
derived
=
pbkdf2
.
Key
([]
byte
(
peerID
),
nil
,
65356
,
aesKeyLength
,
sha256
.
New
)
derived
:=
pbkdf2
.
Key
([]
byte
(
peerID
),
nil
,
65356
,
aesKeyLength
,
sha256
.
New
)
if
!
validateSymmetricKey
(
derived
)
{
t
.
Fatalf
(
"failed validateSymmetricKey with param = %v."
,
derived
)
}
...
...
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