diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-01-14 19:59:57 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:21 +0800 |
commit | 2b03b31d46e166e70ea82b806db47bb6408282e3 (patch) | |
tree | 9f26d62978a5de14078d7e50ddb6714c8996533a /dex/handler.go | |
parent | dca26d3e73ea1657cb7daa2086b74250adbbd85f (diff) | |
download | go-tangerine-2b03b31d46e166e70ea82b806db47bb6408282e3.tar go-tangerine-2b03b31d46e166e70ea82b806db47bb6408282e3.tar.gz go-tangerine-2b03b31d46e166e70ea82b806db47bb6408282e3.tar.bz2 go-tangerine-2b03b31d46e166e70ea82b806db47bb6408282e3.tar.lz go-tangerine-2b03b31d46e166e70ea82b806db47bb6408282e3.tar.xz go-tangerine-2b03b31d46e166e70ea82b806db47bb6408282e3.tar.zst go-tangerine-2b03b31d46e166e70ea82b806db47bb6408282e3.zip |
params: write dMoment into ChainConfig (#150)
Diffstat (limited to 'dex/handler.go')
-rw-r--r-- | dex/handler.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/dex/handler.go b/dex/handler.go index a097605c0..a3fbf2ba9 100644 --- a/dex/handler.go +++ b/dex/handler.go @@ -91,6 +91,7 @@ func errResp(code errCode, format string, v ...interface{}) error { type ProtocolManager struct { networkID uint64 + dMoment uint64 fastSync uint32 // Flag whether fast sync is enabled (gets disabled if we already have blocks) acceptTxs uint32 // Flag whether we're considered synchronised (enables transaction processing) @@ -147,13 +148,14 @@ type ProtocolManager struct { // with the Ethereum network. func NewProtocolManager( config *params.ChainConfig, mode downloader.SyncMode, networkID uint64, - mux *event.TypeMux, txpool txPool, engine consensus.Engine, + dMoment uint64, mux *event.TypeMux, txpool txPool, engine consensus.Engine, blockchain *core.BlockChain, chaindb ethdb.Database, isBlockProposer bool, gov governance, app dexconApp) (*ProtocolManager, error) { tab := newNodeTable() // Create the protocol manager with the base fields manager := &ProtocolManager{ networkID: networkID, + dMoment: dMoment, eventMux: mux, txpool: txpool, nodeTable: tab, @@ -343,7 +345,7 @@ func (pm *ProtocolManager) handle(p *peer) error { hash = head.Hash() number = head.Number.Uint64() ) - if err := p.Handshake(pm.networkID, number, hash, genesis.Hash()); err != nil { + if err := p.Handshake(pm.networkID, pm.dMoment, number, hash, genesis.Hash()); err != nil { p.Log().Debug("Ethereum handshake failed", "err", err) return err } |