core, eth, les, light: get rid of redundant methods

This commit is contained in:
Péter Szilágyi
2018-01-30 18:39:32 +02:00
parent 6198c53e28
commit 566d5c0777
10 changed files with 54 additions and 65 deletions

View File

@ -166,8 +166,12 @@ func newTestPeer(name string, version int, pm *ProtocolManager, shake bool) (*te
tp := &testPeer{app: app, net: net, peer: peer}
// Execute any implicitly requested handshakes and return
if shake {
td, head, genesis := pm.blockchain.Status()
tp.handshake(nil, td, head, genesis)
var (
genesis = pm.blockchain.Genesis()
head = pm.blockchain.CurrentHeader()
td = pm.blockchain.GetTd(head.Hash(), head.Number.Uint64())
)
tp.handshake(nil, td, head.Hash(), genesis.Hash())
}
return tp, errc
}