diff options
author | Egon Elbre <egonelbre@gmail.com> | 2017-08-07 23:25:18 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-08-07 23:25:18 +0800 |
commit | 971079822ee6c12d9348ec78f212fe91c9b83edf (patch) | |
tree | 11c230c8e71a66e1cb9114394fadb8469285a94b | |
parent | f42bd73ce5e9c4d87b0bbcfbd900641305ebe894 (diff) | |
download | dexon-971079822ee6c12d9348ec78f212fe91c9b83edf.tar dexon-971079822ee6c12d9348ec78f212fe91c9b83edf.tar.gz dexon-971079822ee6c12d9348ec78f212fe91c9b83edf.tar.bz2 dexon-971079822ee6c12d9348ec78f212fe91c9b83edf.tar.lz dexon-971079822ee6c12d9348ec78f212fe91c9b83edf.tar.xz dexon-971079822ee6c12d9348ec78f212fe91c9b83edf.tar.zst dexon-971079822ee6c12d9348ec78f212fe91c9b83edf.zip |
light: fix megacheck warnings (#14920)
-rw-r--r-- | light/lightchain.go | 1 | ||||
-rw-r--r-- | light/lightchain_test.go | 13 | ||||
-rw-r--r-- | light/txpool.go | 6 |
3 files changed, 1 insertions, 19 deletions
diff --git a/light/lightchain.go b/light/lightchain.go index 8bbf529cc..a51043975 100644 --- a/light/lightchain.go +++ b/light/lightchain.go @@ -52,7 +52,6 @@ type LightChain struct { mu sync.RWMutex chainmu sync.RWMutex - procmu sync.RWMutex bodyCache *lru.Cache // Cache for the most recent block bodies bodyRLPCache *lru.Cache // Cache for the most recent block bodies in RLP encoded format diff --git a/light/lightchain_test.go b/light/lightchain_test.go index 21b621046..0ad640525 100644 --- a/light/lightchain_test.go +++ b/light/lightchain_test.go @@ -18,7 +18,6 @@ package light import ( "context" - "fmt" "math/big" "testing" @@ -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) } // Extend the newly created chain - var ( - headerChainB []*types.Header - ) - headerChainB = makeHeaderChain(LightChain2.CurrentHeader(), n, db, forkSeed) + headerChainB := makeHeaderChain(LightChain2.CurrentHeader(), n, db, forkSeed) if _, err := LightChain2.InsertHeaderChain(headerChainB, 1); err != nil { 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 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 // the database if successful. func testHeaderChainImport(chain []*types.Header, lightchain *LightChain) error { diff --git a/light/txpool.go b/light/txpool.go index 1d52aa622..7cbb991e8 100644 --- a/light/txpool.go +++ b/light/txpool.go @@ -124,12 +124,6 @@ func (pool *TxPool) GetNonce(ctx context.Context, addr common.Address) (uint64, return nonce, nil } -type txBlockData struct { - BlockHash common.Hash - BlockIndex uint64 - Index uint64 -} - // txStateChanges stores the recent changes between pending/mined states of // transactions. True means mined, false means rolled back, no entry means no change type txStateChanges map[common.Hash]bool |