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
97107982
Commit
97107982
authored
Aug 07, 2017
by
Egon Elbre
Committed by
Felix Lange
Aug 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
light: fix megacheck warnings (#14920)
parent
f42bd73c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
19 deletions
+1
-19
lightchain.go
light/lightchain.go
+0
-1
lightchain_test.go
light/lightchain_test.go
+1
-12
txpool.go
light/txpool.go
+0
-6
No files found.
light/lightchain.go
View file @
97107982
...
@@ -52,7 +52,6 @@ type LightChain struct {
...
@@ -52,7 +52,6 @@ type LightChain struct {
mu
sync
.
RWMutex
mu
sync
.
RWMutex
chainmu
sync
.
RWMutex
chainmu
sync
.
RWMutex
procmu
sync
.
RWMutex
bodyCache
*
lru
.
Cache
// Cache for the most recent block bodies
bodyCache
*
lru
.
Cache
// Cache for the most recent block bodies
bodyRLPCache
*
lru
.
Cache
// Cache for the most recent block bodies in RLP encoded format
bodyRLPCache
*
lru
.
Cache
// Cache for the most recent block bodies in RLP encoded format
...
...
light/lightchain_test.go
View file @
97107982
...
@@ -18,7 +18,6 @@ package light
...
@@ -18,7 +18,6 @@ package light
import
(
import
(
"context"
"context"
"fmt"
"math/big"
"math/big"
"testing"
"testing"
...
@@ -98,10 +97,7 @@ func testFork(t *testing.T, LightChain *LightChain, i, n int, comparator func(td
...
@@ -98,10 +97,7 @@ func testFork(t *testing.T, LightChain *LightChain, i, n int, comparator func(td
t
.
Errorf
(
"chain content mismatch at %d: have hash %v, want hash %v"
,
i
,
hash2
,
hash1
)
t
.
Errorf
(
"chain content mismatch at %d: have hash %v, want hash %v"
,
i
,
hash2
,
hash1
)
}
}
// Extend the newly created chain
// Extend the newly created chain
var
(
headerChainB
:=
makeHeaderChain
(
LightChain2
.
CurrentHeader
(),
n
,
db
,
forkSeed
)
headerChainB
[]
*
types
.
Header
)
headerChainB
=
makeHeaderChain
(
LightChain2
.
CurrentHeader
(),
n
,
db
,
forkSeed
)
if
_
,
err
:=
LightChain2
.
InsertHeaderChain
(
headerChainB
,
1
);
err
!=
nil
{
if
_
,
err
:=
LightChain2
.
InsertHeaderChain
(
headerChainB
,
1
);
err
!=
nil
{
t
.
Fatalf
(
"failed to insert forking chain: %v"
,
err
)
t
.
Fatalf
(
"failed to insert forking chain: %v"
,
err
)
}
}
...
@@ -117,13 +113,6 @@ func testFork(t *testing.T, LightChain *LightChain, i, n int, comparator func(td
...
@@ -117,13 +113,6 @@ func testFork(t *testing.T, LightChain *LightChain, i, n int, comparator func(td
comparator
(
tdPre
,
tdPost
)
comparator
(
tdPre
,
tdPost
)
}
}
func
printChain
(
bc
*
LightChain
)
{
for
i
:=
bc
.
CurrentHeader
()
.
Number
.
Uint64
();
i
>
0
;
i
--
{
b
:=
bc
.
GetHeaderByNumber
(
uint64
(
i
))
fmt
.
Printf
(
"
\t
%x %v
\n
"
,
b
.
Hash
(),
b
.
Difficulty
)
}
}
// testHeaderChainImport tries to process a chain of header, writing them into
// testHeaderChainImport tries to process a chain of header, writing them into
// the database if successful.
// the database if successful.
func
testHeaderChainImport
(
chain
[]
*
types
.
Header
,
lightchain
*
LightChain
)
error
{
func
testHeaderChainImport
(
chain
[]
*
types
.
Header
,
lightchain
*
LightChain
)
error
{
...
...
light/txpool.go
View file @
97107982
...
@@ -124,12 +124,6 @@ func (pool *TxPool) GetNonce(ctx context.Context, addr common.Address) (uint64,
...
@@ -124,12 +124,6 @@ func (pool *TxPool) GetNonce(ctx context.Context, addr common.Address) (uint64,
return
nonce
,
nil
return
nonce
,
nil
}
}
type
txBlockData
struct
{
BlockHash
common
.
Hash
BlockIndex
uint64
Index
uint64
}
// txStateChanges stores the recent changes between pending/mined states of
// txStateChanges stores the recent changes between pending/mined states of
// transactions. True means mined, false means rolled back, no entry means no change
// transactions. True means mined, false means rolled back, no entry means no change
type
txStateChanges
map
[
common
.
Hash
]
bool
type
txStateChanges
map
[
common
.
Hash
]
bool
...
...
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