eth, whisper: adapt for RLP encoder switch in package p2p

I have rewritten the protocol test to use p2p.MsgPipe because
p2p.NewMsg is gone.
This commit is contained in:
Felix Lange
2015-03-19 15:18:31 +01:00
parent b9e0b11e7d
commit e80dda6051
5 changed files with 124 additions and 175 deletions

View File

@ -405,7 +405,7 @@ func (self *Ethereum) txBroadcastLoop() {
// automatically stops if unsubscribe
for obj := range self.txSub.Chan() {
event := obj.(core.TxPreEvent)
self.net.Broadcast("eth", TxMsg, event.Tx.RlpData())
self.net.Broadcast("eth", TxMsg, []*types.Transaction{event.Tx})
}
}
@ -414,7 +414,7 @@ func (self *Ethereum) blockBroadcastLoop() {
for obj := range self.blockSub.Chan() {
switch ev := obj.(type) {
case core.NewMinedBlockEvent:
self.net.Broadcast("eth", NewBlockMsg, ev.Block.RlpData(), ev.Block.Td)
self.net.Broadcast("eth", NewBlockMsg, []interface{}{ev.Block, ev.Block.Td})
}
}
}