aboutsummaryrefslogtreecommitdiffstats
path: root/eth/sync_test.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-05-17 19:17:20 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-05-17 19:17:20 +0800
commitd87f7a1e817cbecbb62c012ed3811ceba933ae3a (patch)
tree438a14920171c8fbbff7995c15bf09a80993a50b /eth/sync_test.go
parentadc1b503957e572c4ec30533de3ec28ec6feea13 (diff)
downloadgo-tangerine-d87f7a1e817cbecbb62c012ed3811ceba933ae3a.tar
go-tangerine-d87f7a1e817cbecbb62c012ed3811ceba933ae3a.tar.gz
go-tangerine-d87f7a1e817cbecbb62c012ed3811ceba933ae3a.tar.bz2
go-tangerine-d87f7a1e817cbecbb62c012ed3811ceba933ae3a.tar.lz
go-tangerine-d87f7a1e817cbecbb62c012ed3811ceba933ae3a.tar.xz
go-tangerine-d87f7a1e817cbecbb62c012ed3811ceba933ae3a.tar.zst
go-tangerine-d87f7a1e817cbecbb62c012ed3811ceba933ae3a.zip
eth: skip transaction handling during fast sync
Diffstat (limited to 'eth/sync_test.go')
-rw-r--r--eth/sync_test.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/eth/sync_test.go b/eth/sync_test.go
index afd90c9b6..198ffaf27 100644
--- a/eth/sync_test.go
+++ b/eth/sync_test.go
@@ -17,6 +17,7 @@
package eth
import (
+ "sync/atomic"
"testing"
"time"
@@ -29,12 +30,12 @@ import (
func TestFastSyncDisabling(t *testing.T) {
// Create a pristine protocol manager, check that fast sync is left enabled
pmEmpty := newTestProtocolManagerMust(t, true, 0, nil, nil)
- if !pmEmpty.fastSync {
+ if atomic.LoadUint32(&pmEmpty.fastSync) == 0 {
t.Fatalf("fast sync disabled on pristine blockchain")
}
// Create a full protocol manager, check that fast sync gets disabled
pmFull := newTestProtocolManagerMust(t, true, 1024, nil, nil)
- if pmFull.fastSync {
+ if atomic.LoadUint32(&pmFull.fastSync) == 1 {
t.Fatalf("fast sync not disabled on non-empty blockchain")
}
// Sync up the two peers
@@ -47,7 +48,7 @@ func TestFastSyncDisabling(t *testing.T) {
pmEmpty.synchronise(pmEmpty.peers.BestPeer())
// Check that fast sync was disabled
- if pmEmpty.fastSync {
+ if atomic.LoadUint32(&pmEmpty.fastSync) == 1 {
t.Fatalf("fast sync not disabled after successful synchronisation")
}
}