mirror of https://github.com/status-im/op-geth.git
Minor changes
This commit is contained in:
parent
1bf6f8b4a6
commit
9ee6295c75
|
@ -271,7 +271,7 @@ func (bc *BlockChain) GetChain(hash []byte, amount int) []*Block {
|
||||||
|
|
||||||
func AddTestNetFunds(block *Block) {
|
func AddTestNetFunds(block *Block) {
|
||||||
for _, addr := range []string{
|
for _, addr := range []string{
|
||||||
"8a40bfaa73256b60764c1bf40675a99083efb075",
|
"51ba59315b3a95761d0863b05ccc7a7f54703d99",
|
||||||
"e4157b34ea9615cfbde6b4fda419828124b70c78",
|
"e4157b34ea9615cfbde6b4fda419828124b70c78",
|
||||||
"1e12515ce3e0f817a4ddef9ca55788a1d66bd2df",
|
"1e12515ce3e0f817a4ddef9ca55788a1d66bd2df",
|
||||||
"6c386a4b26f73c802f34673f7248bb118f97424a",
|
"6c386a4b26f73c802f34673f7248bb118f97424a",
|
||||||
|
@ -285,7 +285,6 @@ func AddTestNetFunds(block *Block) {
|
||||||
account.Amount = ethutil.Big("1606938044258990275541962092341162602522202993782792835301376") //ethutil.BigPow(2, 200)
|
account.Amount = ethutil.Big("1606938044258990275541962092341162602522202993782792835301376") //ethutil.BigPow(2, 200)
|
||||||
block.state.UpdateStateObject(account)
|
block.state.UpdateStateObject(account)
|
||||||
}
|
}
|
||||||
log.Printf("%x\n", block.RlpEncode())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bc *BlockChain) setLastBlock() {
|
func (bc *BlockChain) setLastBlock() {
|
||||||
|
|
|
@ -137,7 +137,7 @@ func (self *Miner) mineNewBlock() {
|
||||||
// Sort the transactions by nonce in case of odd network propagation
|
// Sort the transactions by nonce in case of odd network propagation
|
||||||
sort.Sort(ethchain.TxByNonce{self.txs})
|
sort.Sort(ethchain.TxByNonce{self.txs})
|
||||||
// Accumulate all valid transaction and apply them to the new state
|
// Accumulate all valid transaction and apply them to the new state
|
||||||
receipts, txs := stateManager.ApplyTransactions(self.block.State(), self.block, self.txs)
|
receipts, txs := stateManager.ApplyTransactions(self.block.Coinbase, self.block.State(), self.block, self.txs)
|
||||||
self.txs = txs
|
self.txs = txs
|
||||||
// Set the transactions to the block so the new SHA3 can be calculated
|
// Set the transactions to the block so the new SHA3 can be calculated
|
||||||
self.block.SetReceipts(receipts, txs)
|
self.block.SetReceipts(receipts, txs)
|
||||||
|
@ -155,6 +155,7 @@ func (self *Miner) mineNewBlock() {
|
||||||
} else {
|
} else {
|
||||||
self.ethereum.Broadcast(ethwire.MsgBlockTy, []interface{}{self.block.Value().Val})
|
self.ethereum.Broadcast(ethwire.MsgBlockTy, []interface{}{self.block.Value().Val})
|
||||||
ethutil.Config.Log.Infof("[MINER] 🔨 Mined block %x\n", self.block.Hash())
|
ethutil.Config.Log.Infof("[MINER] 🔨 Mined block %x\n", self.block.Hash())
|
||||||
|
ethutil.Config.Log.Infoln(self.block)
|
||||||
// Gather the new batch of transactions currently in the tx pool
|
// Gather the new batch of transactions currently in the tx pool
|
||||||
self.txs = self.ethereum.TxPool().CurrentTransactions()
|
self.txs = self.ethereum.TxPool().CurrentTransactions()
|
||||||
}
|
}
|
||||||
|
|
4
peer.go
4
peer.go
|
@ -17,7 +17,7 @@ const (
|
||||||
// The size of the output buffer for writing messages
|
// The size of the output buffer for writing messages
|
||||||
outputBufferSize = 50
|
outputBufferSize = 50
|
||||||
// Current protocol version
|
// Current protocol version
|
||||||
ProtocolVersion = 17
|
ProtocolVersion = 20
|
||||||
)
|
)
|
||||||
|
|
||||||
type DiscReason byte
|
type DiscReason byte
|
||||||
|
@ -603,7 +603,7 @@ func (p *Peer) handleHandshake(msg *ethwire.Msg) {
|
||||||
c := msg.Data
|
c := msg.Data
|
||||||
|
|
||||||
if c.Get(0).Uint() != ProtocolVersion {
|
if c.Get(0).Uint() != ProtocolVersion {
|
||||||
ethutil.Config.Log.Debugln("Invalid peer version. Require protocol:", ProtocolVersion)
|
ethutil.Config.Log.Debugf("Invalid peer version. Require protocol: %d. Received: %d\n", ProtocolVersion, c.Get(0).Uint())
|
||||||
p.Stop()
|
p.Stop()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue