Skip to content

Commit 9710798

Browse files
egonelbrefjl
authored andcommitted
light: fix megacheck warnings (#14920)
1 parent f42bd73 commit 9710798

3 files changed

Lines changed: 1 addition & 19 deletions

File tree

‎light/lightchain.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ type LightChain struct {
5252

5353
mu sync.RWMutex
5454
chainmu sync.RWMutex
55-
procmu sync.RWMutex
5655

5756
bodyCache *lru.Cache // Cache for the most recent block bodies
5857
bodyRLPCache *lru.Cache // Cache for the most recent block bodies in RLP encoded format

‎light/lightchain_test.go‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package light
1818

1919
import (
2020
"context"
21-
"fmt"
2221
"math/big"
2322
"testing"
2423

@@ -98,10 +97,7 @@ func testFork(t *testing.T, LightChain *LightChain, i, n int, comparator func(td
9897
t.Errorf("chain content mismatch at %d: have hash %v, want hash %v", i, hash2, hash1)
9998
}
10099
// Extend the newly created chain
101-
var (
102-
headerChainB []*types.Header
103-
)
104-
headerChainB = makeHeaderChain(LightChain2.CurrentHeader(), n, db, forkSeed)
100+
headerChainB := makeHeaderChain(LightChain2.CurrentHeader(), n, db, forkSeed)
105101
if _, err := LightChain2.InsertHeaderChain(headerChainB, 1); err != nil {
106102
t.Fatalf("failed to insert forking chain: %v", err)
107103
}
@@ -117,13 +113,6 @@ func testFork(t *testing.T, LightChain *LightChain, i, n int, comparator func(td
117113
comparator(tdPre, tdPost)
118114
}
119115

120-
func printChain(bc *LightChain) {
121-
for i := bc.CurrentHeader().Number.Uint64(); i > 0; i-- {
122-
b := bc.GetHeaderByNumber(uint64(i))
123-
fmt.Printf("\t%x %v\n", b.Hash(), b.Difficulty)
124-
}
125-
}
126-
127116
// testHeaderChainImport tries to process a chain of header, writing them into
128117
// the database if successful.
129118
func testHeaderChainImport(chain []*types.Header, lightchain *LightChain) error {

‎light/txpool.go‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,6 @@ func (pool *TxPool) GetNonce(ctx context.Context, addr common.Address) (uint64,
124124
return nonce, nil
125125
}
126126

127-
type txBlockData struct {
128-
BlockHash common.Hash
129-
BlockIndex uint64
130-
Index uint64
131-
}
132-
133127
// txStateChanges stores the recent changes between pending/mined states of
134128
// transactions. True means mined, false means rolled back, no entry means no change
135129
type txStateChanges map[common.Hash]bool

0 commit comments

Comments
 (0)