aboutsummaryrefslogtreecommitdiffstats
path: root/simulation
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-09-17 17:16:26 +0800
committerGitHub <noreply@github.com>2018-09-17 17:16:26 +0800
commit874c4c599a80b9c6f9c085c216be5fd6492cd2c2 (patch)
tree390ff0d0ad11712612b2ee96a1703528c5789773 /simulation
parent2110dcdae6ef551cedc006649a1ae1f429bcc013 (diff)
downloaddexon-consensus-874c4c599a80b9c6f9c085c216be5fd6492cd2c2.tar
dexon-consensus-874c4c599a80b9c6f9c085c216be5fd6492cd2c2.tar.gz
dexon-consensus-874c4c599a80b9c6f9c085c216be5fd6492cd2c2.tar.bz2
dexon-consensus-874c4c599a80b9c6f9c085c216be5fd6492cd2c2.tar.lz
dexon-consensus-874c4c599a80b9c6f9c085c216be5fd6492cd2c2.tar.xz
dexon-consensus-874c4c599a80b9c6f9c085c216be5fd6492cd2c2.tar.zst
dexon-consensus-874c4c599a80b9c6f9c085c216be5fd6492cd2c2.zip
cleanup (#109)
- With context, we don't need stopChan - Remove core.BlockChain. - Remove unused variable.
Diffstat (limited to 'simulation')
-rw-r--r--simulation/validator.go33
1 files changed, 15 insertions, 18 deletions
diff --git a/simulation/validator.go b/simulation/validator.go
index 46d42d3..483912b 100644
--- a/simulation/validator.go
+++ b/simulation/validator.go
@@ -36,16 +36,14 @@ type validator struct {
gov *simGovernance
db blockdb.BlockDatabase
- config config.Validator
- netModule *network
- isFinished chan struct{}
+ config config.Validator
+ netModule *network
- ID types.ValidatorID
- chainID uint64
- prvKey crypto.PrivateKey
- sigToPub core.SigToPubFn
- consensus *core.Consensus
- compactionChain *core.BlockChain
+ ID types.ValidatorID
+ chainID uint64
+ prvKey crypto.PrivateKey
+ sigToPub core.SigToPubFn
+ consensus *core.Consensus
}
// newValidator returns a new empty validator.
@@ -63,15 +61,14 @@ func newValidator(
}
gov := newSimGovernance(config.Validator.Num, config.Validator.Consensus)
return &validator{
- ID: id,
- prvKey: prvKey,
- sigToPub: sigToPub,
- config: config.Validator,
- app: newSimApp(id, netModule),
- gov: gov,
- db: db,
- netModule: netModule,
- isFinished: make(chan struct{}),
+ ID: id,
+ prvKey: prvKey,
+ sigToPub: sigToPub,
+ config: config.Validator,
+ app: newSimApp(id, netModule),
+ gov: gov,
+ db: db,
+ netModule: netModule,
}
}