diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/asm.go | 2 | ||||
-rw-r--r-- | core/blockchain.go | 4 | ||||
-rw-r--r-- | core/state/sync_test.go | 10 | ||||
-rw-r--r-- | core/vm/asm.go | 2 | ||||
-rw-r--r-- | core/vm/jit_util_test.go | 2 |
5 files changed, 8 insertions, 12 deletions
diff --git a/core/asm.go b/core/asm.go index a86a2c44c..b2e47b5e9 100644 --- a/core/asm.go +++ b/core/asm.go @@ -61,6 +61,4 @@ func Disassemble(script []byte) (asm []string) { pc.Add(pc, common.Big1) } - - return asm } diff --git a/core/blockchain.go b/core/blockchain.go index e740eb861..ecf8297cb 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -993,7 +993,7 @@ func (self *BlockChain) reorg(oldBlock, newBlock *types.Block) error { // first reduce whoever is higher bound if oldBlock.NumberU64() > newBlock.NumberU64() { // reduce old chain - for oldBlock = oldBlock; oldBlock != nil && oldBlock.NumberU64() != newBlock.NumberU64(); oldBlock = self.GetBlock(oldBlock.ParentHash()) { + for ; oldBlock != nil && oldBlock.NumberU64() != newBlock.NumberU64(); oldBlock = self.GetBlock(oldBlock.ParentHash()) { oldChain = append(oldChain, oldBlock) deletedTxs = append(deletedTxs, oldBlock.Transactions()...) @@ -1001,7 +1001,7 @@ func (self *BlockChain) reorg(oldBlock, newBlock *types.Block) error { } } else { // reduce new chain and append new chain blocks for inserting later on - for newBlock = newBlock; newBlock != nil && newBlock.NumberU64() != oldBlock.NumberU64(); newBlock = self.GetBlock(newBlock.ParentHash()) { + for ; newBlock != nil && newBlock.NumberU64() != oldBlock.NumberU64(); newBlock = self.GetBlock(newBlock.ParentHash()) { newChain = append(newChain, newBlock) } } diff --git a/core/state/sync_test.go b/core/state/sync_test.go index a2a1edbdb..715645c6c 100644 --- a/core/state/sync_test.go +++ b/core/state/sync_test.go @@ -145,7 +145,7 @@ func testIterativeStateSync(t *testing.T, batch int) { if err != nil { t.Fatalf("failed to retrieve node data for %x: %v", hash, err) } - results[i] = trie.SyncResult{hash, data} + results[i] = trie.SyncResult{Hash: hash, Data: data} } if index, err := sched.Process(results); err != nil { t.Fatalf("failed to process result #%d: %v", index, err) @@ -175,7 +175,7 @@ func TestIterativeDelayedStateSync(t *testing.T) { if err != nil { t.Fatalf("failed to retrieve node data for %x: %v", hash, err) } - results[i] = trie.SyncResult{hash, data} + results[i] = trie.SyncResult{Hash: hash, Data: data} } if index, err := sched.Process(results); err != nil { t.Fatalf("failed to process result #%d: %v", index, err) @@ -212,7 +212,7 @@ func testIterativeRandomStateSync(t *testing.T, batch int) { if err != nil { t.Fatalf("failed to retrieve node data for %x: %v", hash, err) } - results = append(results, trie.SyncResult{hash, data}) + results = append(results, trie.SyncResult{Hash: hash, Data: data}) } // Feed the retrieved results back and queue new tasks if index, err := sched.Process(results); err != nil { @@ -251,7 +251,7 @@ func TestIterativeRandomDelayedStateSync(t *testing.T) { if err != nil { t.Fatalf("failed to retrieve node data for %x: %v", hash, err) } - results = append(results, trie.SyncResult{hash, data}) + results = append(results, trie.SyncResult{Hash: hash, Data: data}) if len(results) >= cap(results) { break @@ -289,7 +289,7 @@ func TestIncompleteStateSync(t *testing.T) { if err != nil { t.Fatalf("failed to retrieve node data for %x: %v", hash, err) } - results[i] = trie.SyncResult{hash, data} + results[i] = trie.SyncResult{Hash: hash, Data: data} } // Process each of the state nodes if index, err := sched.Process(results); err != nil { diff --git a/core/vm/asm.go b/core/vm/asm.go index b248838a7..d7dbde5e8 100644 --- a/core/vm/asm.go +++ b/core/vm/asm.go @@ -58,6 +58,4 @@ func Disassemble(script []byte) (asm []string) { pc.Add(pc, common.Big1) } - - return } diff --git a/core/vm/jit_util_test.go b/core/vm/jit_util_test.go index 1f4cb2b16..2123efe59 100644 --- a/core/vm/jit_util_test.go +++ b/core/vm/jit_util_test.go @@ -77,7 +77,7 @@ func TestParser(t *testing.T) { t.Fatal("empty output") } if output[0] != test.output { - t.Error("%v failed: expected %v but got %v", test.base+OpCode(i), output[0]) + t.Errorf("%v failed: expected %v but got %v", test.base+OpCode(i), test.output, output[0]) } } } |