aboutsummaryrefslogtreecommitdiffstats
path: root/dex/handler.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-03-17 10:43:10 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:58 +0800
commit64f26af59d24881bcdd49bbdd291c1a21a12b82d (patch)
tree4968dc2006c6cabd118fc200b85bd05dc180efd0 /dex/handler.go
parent2818ad97f5b302f76e3296195bf8daae1868c435 (diff)
downloadgo-tangerine-64f26af59d24881bcdd49bbdd291c1a21a12b82d.tar
go-tangerine-64f26af59d24881bcdd49bbdd291c1a21a12b82d.tar.gz
go-tangerine-64f26af59d24881bcdd49bbdd291c1a21a12b82d.tar.bz2
go-tangerine-64f26af59d24881bcdd49bbdd291c1a21a12b82d.tar.lz
go-tangerine-64f26af59d24881bcdd49bbdd291c1a21a12b82d.tar.xz
go-tangerine-64f26af59d24881bcdd49bbdd291c1a21a12b82d.tar.zst
go-tangerine-64f26af59d24881bcdd49bbdd291c1a21a12b82d.zip
core: fill in genesis timstamp and remove dMoment from protocol handshake (#263)
Fill in dmoment as genesis block timestamp. This allow us to remove dMoment check from protocol handshake since genesis block hash itself will protect us against different dMoment.
Diffstat (limited to 'dex/handler.go')
-rw-r--r--dex/handler.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/dex/handler.go b/dex/handler.go
index 76219c747..ea04e6fbc 100644
--- a/dex/handler.go
+++ b/dex/handler.go
@@ -97,7 +97,6 @@ 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)
@@ -158,14 +157,13 @@ type ProtocolManager struct {
// with the Ethereum network.
func NewProtocolManager(
config *params.ChainConfig, mode downloader.SyncMode, networkID uint64,
- dMoment uint64, mux *event.TypeMux, txpool txPool, engine consensus.Engine,
+ 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,
@@ -355,7 +353,7 @@ func (pm *ProtocolManager) handle(p *peer) error {
hash = head.Hash()
number = head.Number.Uint64()
)
- if err := p.Handshake(pm.networkID, pm.dMoment, number, hash, genesis.Hash()); err != nil {
+ if err := p.Handshake(pm.networkID, number, hash, genesis.Hash()); err != nil {
p.Log().Debug("Ethereum handshake failed", "err", err)
return err
}