forked from cerc-io/plugeth
Updated peers
This commit is contained in:
parent
233f5200ef
commit
1b7cba1878
@ -60,7 +60,7 @@ func New() (*Ethereum, error) {
|
|||||||
}
|
}
|
||||||
ethereum.TxPool = ethchain.NewTxPool()
|
ethereum.TxPool = ethchain.NewTxPool()
|
||||||
ethereum.TxPool.Speaker = ethereum
|
ethereum.TxPool.Speaker = ethereum
|
||||||
ethereum.BlockManager = ethchain.NewBlockManager()
|
ethereum.BlockManager = ethchain.NewBlockManager(ethereum)
|
||||||
|
|
||||||
ethereum.TxPool.BlockManager = ethereum.BlockManager
|
ethereum.TxPool.BlockManager = ethereum.BlockManager
|
||||||
ethereum.BlockManager.TransactionPool = ethereum.TxPool
|
ethereum.BlockManager.TransactionPool = ethereum.TxPool
|
||||||
|
16
peer.go
16
peer.go
@ -128,7 +128,7 @@ out:
|
|||||||
p.lastSend = time.Now()
|
p.lastSend = time.Now()
|
||||||
|
|
||||||
case <-tickleTimer.C:
|
case <-tickleTimer.C:
|
||||||
p.writeMessage(ðwire.Msg{Type: ethwire.MsgPingTy})
|
p.writeMessage(ethwire.NewMessage(ethwire.MsgPingTy, ""))
|
||||||
|
|
||||||
// Break out of the for loop if a quit message is posted
|
// Break out of the for loop if a quit message is posted
|
||||||
case <-p.quit:
|
case <-p.quit:
|
||||||
@ -170,12 +170,12 @@ out:
|
|||||||
// Version message
|
// Version message
|
||||||
p.handleHandshake(msg)
|
p.handleHandshake(msg)
|
||||||
case ethwire.MsgBlockTy:
|
case ethwire.MsgBlockTy:
|
||||||
/*
|
block := ethchain.NewBlockFromRlpValue(msg.Data.Get(0))
|
||||||
err := p.ethereum.BlockManager.ProcessBlock(ethchain.NewBlock(msg.Data))
|
block.MakeContracts()
|
||||||
if err != nil {
|
err := p.ethereum.BlockManager.ProcessBlock(block)
|
||||||
log.Println(err)
|
if err != nil {
|
||||||
}
|
log.Println(err)
|
||||||
*/
|
}
|
||||||
case ethwire.MsgTxTy:
|
case ethwire.MsgTxTy:
|
||||||
//p.ethereum.TxPool.QueueTransaction(ethchain.NewTransactionFromData(msg.Data))
|
//p.ethereum.TxPool.QueueTransaction(ethchain.NewTransactionFromData(msg.Data))
|
||||||
p.ethereum.TxPool.QueueTransaction(ethchain.NewTransactionFromRlpValue(msg.Data.Get(0)))
|
p.ethereum.TxPool.QueueTransaction(ethchain.NewTransactionFromRlpValue(msg.Data.Get(0)))
|
||||||
@ -203,7 +203,7 @@ out:
|
|||||||
}
|
}
|
||||||
case ethwire.MsgPingTy:
|
case ethwire.MsgPingTy:
|
||||||
// Respond back with pong
|
// Respond back with pong
|
||||||
p.QueueMessage(ðwire.Msg{Type: ethwire.MsgPongTy})
|
p.QueueMessage(ethwire.NewMessage(ethwire.MsgPongTy, ""))
|
||||||
case ethwire.MsgPongTy:
|
case ethwire.MsgPongTy:
|
||||||
p.lastPong = time.Now().Unix()
|
p.lastPong = time.Now().Unix()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user