aboutsummaryrefslogtreecommitdiffstats
path: root/les/helper_test.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 /les/helper_test.go
parent6198c53e28200b3a575f4545cbfa83c585e44b76 (diff)
downloaddexon-566d5c0777c2c5ee1a8fe3c0aee1e5c8c69053e2.tar.gz
dexon-566d5c0777c2c5ee1a8fe3c0aee1e5c8c69053e2.tar.zst
dexon-566d5c0777c2c5ee1a8fe3c0aee1e5c8c69053e2.zip
core, eth, les, light: get rid of redundant methods
Diffstat (limited to 'les/helper_test.go')
-rw-r--r--les/helper_test.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/les/helper_test.go b/les/helper_test.go
index b881b41ce..57e693996 100644
--- a/les/helper_test.go
+++ b/les/helper_test.go
@@ -227,9 +227,12 @@ func newTestPeer(t *testing.T, name string, version int, pm *ProtocolManager, sh
}
// Execute any implicitly requested handshakes and return
if shake {
- td, head, genesis := pm.blockchain.Status()
- headNum := pm.blockchain.CurrentHeader().Number.Uint64()
- tp.handshake(t, td, head, headNum, genesis)
+ var (
+ genesis = pm.blockchain.Genesis()
+ head = pm.blockchain.CurrentHeader()
+ td = pm.blockchain.GetTd(head.Hash(), head.Number.Uint64())
+ )
+ tp.handshake(t, td, head.Hash(), head.Number.Uint64(), genesis.Hash())
}
return tp, errc
}