aboutsummaryrefslogtreecommitdiffstats
path: root/eth/handler.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-01-31 00:39:32 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-01-31 00:42:00 +0800
commit566d5c0777c2c5ee1a8fe3c0aee1e5c8c69053e2 (patch)
treed1b99b9caab92cce3f6a6a4f8dcafb66a892e13a /eth/handler.go
parent6198c53e28200b3a575f4545cbfa83c585e44b76 (diff)
downloaddexon-566d5c0777c2c5ee1a8fe3c0aee1e5c8c69053e2.tar
dexon-566d5c0777c2c5ee1a8fe3c0aee1e5c8c69053e2.tar.gz
dexon-566d5c0777c2c5ee1a8fe3c0aee1e5c8c69053e2.tar.bz2
dexon-566d5c0777c2c5ee1a8fe3c0aee1e5c8c69053e2.tar.lz
dexon-566d5c0777c2c5ee1a8fe3c0aee1e5c8c69053e2.tar.xz
dexon-566d5c0777c2c5ee1a8fe3c0aee1e5c8c69053e2.tar.zst
dexon-566d5c0777c2c5ee1a8fe3c0aee1e5c8c69053e2.zip
core, eth, les, light: get rid of redundant methods
Diffstat (limited to 'eth/handler.go')
-rw-r--r--eth/handler.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/eth/handler.go b/eth/handler.go
index 074cffd96..fcd53c5a6 100644
--- a/eth/handler.go
+++ b/eth/handler.go
@@ -257,8 +257,14 @@ func (pm *ProtocolManager) handle(p *peer) error {
p.Log().Debug("Ethereum peer connected", "name", p.Name())
// Execute the Ethereum handshake
- td, head, genesis := pm.blockchain.Status()
- if err := p.Handshake(pm.networkId, td, head, genesis); err != nil {
+ var (
+ genesis = pm.blockchain.Genesis()
+ head = pm.blockchain.CurrentHeader()
+ hash = head.Hash()
+ number = head.Number.Uint64()
+ td = pm.blockchain.GetTd(hash, number)
+ )
+ if err := p.Handshake(pm.networkId, td, hash, genesis.Hash()); err != nil {
p.Log().Debug("Ethereum handshake failed", "err", err)
return err
}