aboutsummaryrefslogtreecommitdiffstats
path: root/dex/backend.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-11-15 13:30:50 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:18 +0800
commitdbb3d8fd30bd33df37f13048dc334ead8d335ddc (patch)
tree7f22be12a919cacdc79912444b34d20523448582 /dex/backend.go
parent281bf328e19274e21416ecbbc5c01f6243c1ad6f (diff)
downloadgo-tangerine-dbb3d8fd30bd33df37f13048dc334ead8d335ddc.tar
go-tangerine-dbb3d8fd30bd33df37f13048dc334ead8d335ddc.tar.gz
go-tangerine-dbb3d8fd30bd33df37f13048dc334ead8d335ddc.tar.bz2
go-tangerine-dbb3d8fd30bd33df37f13048dc334ead8d335ddc.tar.lz
go-tangerine-dbb3d8fd30bd33df37f13048dc334ead8d335ddc.tar.xz
go-tangerine-dbb3d8fd30bd33df37f13048dc334ead8d335ddc.tar.zst
go-tangerine-dbb3d8fd30bd33df37f13048dc334ead8d335ddc.zip
core: refactor validator and fix light node sync (#25)
Remove custom Dexon validator by adding a new `ValidateWitnessData` method into the validator interface. This allow us to properly detect know blocks. This also allow other gdex "light" client to sync compaction chain. Also, setup a standalone RPC node for handling RPC reqeusts.
Diffstat (limited to 'dex/backend.go')
-rw-r--r--dex/backend.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/dex/backend.go b/dex/backend.go
index d7bc4630e..740b8cd6f 100644
--- a/dex/backend.go
+++ b/dex/backend.go
@@ -134,8 +134,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Dexon, error) {
}
cacheConfig = &core.CacheConfig{Disabled: config.NoPruning, TrieCleanLimit: config.TrieCleanCache, TrieDirtyLimit: config.TrieDirtyCache, TrieTimeLimit: config.TrieTimeout}
)
- dex.blockchain, err = core.NewBlockChainWithDexonValidator(chainDb, cacheConfig,
- dex.chainConfig, dex.engine, vmConfig, nil)
+ dex.blockchain, err = core.NewBlockChain(chainDb, cacheConfig, dex.chainConfig, dex.engine, vmConfig, nil)
// Rewind the chain in case of an incompatible config upgrade.
if compat, ok := genesisErr.(*params.ConfigCompatError); ok {
@@ -148,7 +147,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Dexon, error) {
if config.TxPool.Journal != "" {
config.TxPool.Journal = ctx.ResolvePath(config.TxPool.Journal)
}
- dex.txPool = core.NewTxPool(config.TxPool, dex.chainConfig, dex.blockchain)
+ dex.txPool = core.NewTxPool(config.TxPool, dex.chainConfig, dex.blockchain, config.BlockProposerEnabled)
dex.APIBackend = &DexAPIBackend{dex, nil}
gpoParams := config.GPO
@@ -166,7 +165,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Dexon, error) {
pm, err := NewProtocolManager(dex.chainConfig, config.SyncMode,
config.NetworkId, dex.eventMux, dex.txPool, dex.engine, dex.blockchain,
- chainDb, dex.governance)
+ chainDb, config.BlockProposerEnabled, dex.governance)
if err != nil {
return nil, err
}