aboutsummaryrefslogtreecommitdiffstats
path: root/peer.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-01-25 00:48:21 +0800
committerobscuren <geffobscura@gmail.com>2014-01-25 00:48:21 +0800
commit1b7cba18781ddd6ff262801057930367ea397c9e (patch)
tree183a99650c7e360098e5002915f95da62cc9515b /peer.go
parent233f5200ef77ee77b4d33b5ff277d0e524b1fb4d (diff)
downloadgo-tangerine-1b7cba18781ddd6ff262801057930367ea397c9e.tar
go-tangerine-1b7cba18781ddd6ff262801057930367ea397c9e.tar.gz
go-tangerine-1b7cba18781ddd6ff262801057930367ea397c9e.tar.bz2
go-tangerine-1b7cba18781ddd6ff262801057930367ea397c9e.tar.lz
go-tangerine-1b7cba18781ddd6ff262801057930367ea397c9e.tar.xz
go-tangerine-1b7cba18781ddd6ff262801057930367ea397c9e.tar.zst
go-tangerine-1b7cba18781ddd6ff262801057930367ea397c9e.zip
Updated peers
Diffstat (limited to 'peer.go')
-rw-r--r--peer.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/peer.go b/peer.go
index 4f799e890..afbe728fe 100644
--- a/peer.go
+++ b/peer.go
@@ -128,7 +128,7 @@ out:
p.lastSend = time.Now()
case <-tickleTimer.C:
- p.writeMessage(&ethwire.Msg{Type: ethwire.MsgPingTy})
+ p.writeMessage(ethwire.NewMessage(ethwire.MsgPingTy, ""))
// Break out of the for loop if a quit message is posted
case <-p.quit:
@@ -170,12 +170,12 @@ out:
// Version message
p.handleHandshake(msg)
case ethwire.MsgBlockTy:
- /*
- err := p.ethereum.BlockManager.ProcessBlock(ethchain.NewBlock(msg.Data))
- if err != nil {
- log.Println(err)
- }
- */
+ block := ethchain.NewBlockFromRlpValue(msg.Data.Get(0))
+ block.MakeContracts()
+ err := p.ethereum.BlockManager.ProcessBlock(block)
+ if err != nil {
+ log.Println(err)
+ }
case ethwire.MsgTxTy:
//p.ethereum.TxPool.QueueTransaction(ethchain.NewTransactionFromData(msg.Data))
p.ethereum.TxPool.QueueTransaction(ethchain.NewTransactionFromRlpValue(msg.Data.Get(0)))
@@ -203,7 +203,7 @@ out:
}
case ethwire.MsgPingTy:
// Respond back with pong
- p.QueueMessage(&ethwire.Msg{Type: ethwire.MsgPongTy})
+ p.QueueMessage(ethwire.NewMessage(ethwire.MsgPongTy, ""))
case ethwire.MsgPongTy:
p.lastPong = time.Now().Unix()
}