aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2017-01-09 18:16:06 +0800
committerFelix Lange <fjl@twurst.com>2017-01-09 23:24:42 +0800
commitb9b3efb09f9281a5859646d2dcf36b5813132efb (patch)
treef9dc8f9d82108b33bec4669b09a99d06d24239a9 /core
parent0f34d506b5ae9b76de97318c906e56dddd5309f6 (diff)
downloaddexon-b9b3efb09f9281a5859646d2dcf36b5813132efb.tar
dexon-b9b3efb09f9281a5859646d2dcf36b5813132efb.tar.gz
dexon-b9b3efb09f9281a5859646d2dcf36b5813132efb.tar.bz2
dexon-b9b3efb09f9281a5859646d2dcf36b5813132efb.tar.lz
dexon-b9b3efb09f9281a5859646d2dcf36b5813132efb.tar.xz
dexon-b9b3efb09f9281a5859646d2dcf36b5813132efb.tar.zst
dexon-b9b3efb09f9281a5859646d2dcf36b5813132efb.zip
all: fix ineffectual assignments and remove uses of crypto.Sha3
go get github.com/gordonklaus/ineffassign ineffassign .
Diffstat (limited to 'core')
-rw-r--r--core/blockchain.go3
-rw-r--r--core/state/managed_state_test.go8
2 files changed, 5 insertions, 6 deletions
diff --git a/core/blockchain.go b/core/blockchain.go
index c3530b93c..8eb7de982 100644
--- a/core/blockchain.go
+++ b/core/blockchain.go
@@ -1054,11 +1054,10 @@ func (st *insertStats) report(chain []*types.Block, index int) {
start, end := chain[st.lastIndex], chain[index]
txcount := countTransactions(chain[st.lastIndex : index+1])
- extra := ""
+ var hashes, extra string
if st.queued > 0 || st.ignored > 0 {
extra = fmt.Sprintf(" (%d queued %d ignored)", st.queued, st.ignored)
}
- hashes := ""
if st.processed > 1 {
hashes = fmt.Sprintf("%x… / %x…", start.Hash().Bytes()[:4], end.Hash().Bytes()[:4])
} else {
diff --git a/core/state/managed_state_test.go b/core/state/managed_state_test.go
index d9c232ebb..0a3be9f5a 100644
--- a/core/state/managed_state_test.go
+++ b/core/state/managed_state_test.go
@@ -88,12 +88,12 @@ func TestRemoteNonceChange(t *testing.T) {
nn[i] = true
}
account.nonces = append(account.nonces, nn...)
- nonce := ms.NewNonce(addr)
+ ms.NewNonce(addr)
ms.StateDB.stateObjects[addr].data.Nonce = 200
- nonce = ms.NewNonce(addr)
+ nonce := ms.NewNonce(addr)
if nonce != 200 {
- t.Error("expected nonce after remote update to be", 201, "got", nonce)
+ t.Error("expected nonce after remote update to be", 200, "got", nonce)
}
ms.NewNonce(addr)
ms.NewNonce(addr)
@@ -101,7 +101,7 @@ func TestRemoteNonceChange(t *testing.T) {
ms.StateDB.stateObjects[addr].data.Nonce = 200
nonce = ms.NewNonce(addr)
if nonce != 204 {
- t.Error("expected nonce after remote update to be", 201, "got", nonce)
+ t.Error("expected nonce after remote update to be", 204, "got", nonce)
}
}