Data send over the wire shouldn't be RLPed more then once

This commit is contained in:
obscuren
2014-01-23 22:32:50 +01:00
parent 878e796c0a
commit 233f5200ef
2 changed files with 12 additions and 8 deletions

View File

@ -122,9 +122,10 @@ func (s *Ethereum) InboundPeers() []*Peer {
return inboundPeers[:length]
}
func (s *Ethereum) Broadcast(msgType ethwire.MsgType, data []byte) {
func (s *Ethereum) Broadcast(msgType ethwire.MsgType, data interface{}) {
msg := ethwire.NewMessage(msgType, data)
eachPeer(s.peers, func(p *Peer, e *list.Element) {
p.QueueMessage(ethwire.NewMessage(msgType, data))
p.QueueMessage(msg)
})
}