put back extra debug detail logging to the right places using logger.DebugDetailf
This commit is contained in:
parent
6465e4c3fd
commit
a02edf7a93
@ -158,7 +158,7 @@ func (c *StateObject) ConvertGas(gas, price *big.Int) error {
|
|||||||
func (self *StateObject) SetGasPool(gasLimit *big.Int) {
|
func (self *StateObject) SetGasPool(gasLimit *big.Int) {
|
||||||
self.gasPool = new(big.Int).Set(gasLimit)
|
self.gasPool = new(big.Int).Set(gasLimit)
|
||||||
|
|
||||||
statelogger.Infof("%x: fuel (+ %v)", self.Address(), self.gasPool)
|
statelogger.DebugDetailf("%x: fuel (+ %v)", self.Address(), self.gasPool)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *StateObject) BuyGas(gas, price *big.Int) error {
|
func (self *StateObject) BuyGas(gas, price *big.Int) error {
|
||||||
|
14
peer.go
14
peer.go
@ -250,7 +250,7 @@ func (p *Peer) writeMessage(msg *ethwire.Msg) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
peerlogger.Infoln("<=", msg.Type, msg.Data)
|
peerlogger.DebugDetailln("<=", msg.Type, msg.Data)
|
||||||
|
|
||||||
err := ethwire.WriteMessage(p.conn, msg)
|
err := ethwire.WriteMessage(p.conn, msg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -324,7 +324,7 @@ func (p *Peer) HandleInbound() {
|
|||||||
peerlogger.Debugln(err)
|
peerlogger.Debugln(err)
|
||||||
}
|
}
|
||||||
for _, msg := range msgs {
|
for _, msg := range msgs {
|
||||||
peerlogger.Infoln("=>", msg.Type, msg.Data)
|
peerlogger.DebugDetailln("=>", msg.Type, msg.Data)
|
||||||
|
|
||||||
switch msg.Type {
|
switch msg.Type {
|
||||||
case ethwire.MsgHandshakeTy:
|
case ethwire.MsgHandshakeTy:
|
||||||
@ -429,7 +429,7 @@ func (p *Peer) HandleInbound() {
|
|||||||
if p.catchingUp && msg.Data.Len() > 1 {
|
if p.catchingUp && msg.Data.Len() > 1 {
|
||||||
if lastBlock != nil {
|
if lastBlock != nil {
|
||||||
blockInfo := lastBlock.BlockInfo()
|
blockInfo := lastBlock.BlockInfo()
|
||||||
peerlogger.Infof("Synced chain to #%d %x %x\n", blockInfo.Number, lastBlock.Hash(), blockInfo.Hash)
|
peerlogger.DebugDetailf("Synced chain to #%d %x %x\n", blockInfo.Number, lastBlock.Hash(), blockInfo.Hash)
|
||||||
}
|
}
|
||||||
|
|
||||||
p.catchingUp = false
|
p.catchingUp = false
|
||||||
@ -496,7 +496,7 @@ func (p *Peer) HandleInbound() {
|
|||||||
|
|
||||||
// If a parent is found send back a reply
|
// If a parent is found send back a reply
|
||||||
if parent != nil {
|
if parent != nil {
|
||||||
peerlogger.Infof("Found canonical block, returning chain from: %x ", parent.Hash())
|
peerlogger.DebugDetailf("Found canonical block, returning chain from: %x ", parent.Hash())
|
||||||
chain := p.ethereum.BlockChain().GetChainFromHash(parent.Hash(), amountOfBlocks)
|
chain := p.ethereum.BlockChain().GetChainFromHash(parent.Hash(), amountOfBlocks)
|
||||||
if len(chain) > 0 {
|
if len(chain) > 0 {
|
||||||
//peerlogger.Debugf("Returning %d blocks: %x ", len(chain), parent.Hash())
|
//peerlogger.Debugf("Returning %d blocks: %x ", len(chain), parent.Hash())
|
||||||
@ -516,7 +516,7 @@ func (p *Peer) HandleInbound() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
case ethwire.MsgNotInChainTy:
|
case ethwire.MsgNotInChainTy:
|
||||||
peerlogger.Infof("Not in chain: %x\n", msg.Data.Get(0).Bytes())
|
peerlogger.DebugDetailf("Not in chain: %x\n", msg.Data.Get(0).Bytes())
|
||||||
if p.diverted == true {
|
if p.diverted == true {
|
||||||
// If were already looking for a common parent and we get here again we need to go deeper
|
// If were already looking for a common parent and we get here again we need to go deeper
|
||||||
p.blocksRequested = p.blocksRequested * 2
|
p.blocksRequested = p.blocksRequested * 2
|
||||||
@ -737,7 +737,7 @@ func (p *Peer) FindCommonParentBlock() {
|
|||||||
|
|
||||||
msgInfo := append(hashes, uint64(len(hashes)))
|
msgInfo := append(hashes, uint64(len(hashes)))
|
||||||
|
|
||||||
peerlogger.Infof("Asking for block from %x (%d total) from %s\n", p.ethereum.BlockChain().CurrentBlock.Hash(), len(hashes), p.conn.RemoteAddr().String())
|
peerlogger.DebugDetailf("Asking for block from %x (%d total) from %s\n", p.ethereum.BlockChain().CurrentBlock.Hash(), len(hashes), p.conn.RemoteAddr().String())
|
||||||
|
|
||||||
msg := ethwire.NewMessage(ethwire.MsgGetChainTy, msgInfo)
|
msg := ethwire.NewMessage(ethwire.MsgGetChainTy, msgInfo)
|
||||||
p.QueueMessage(msg)
|
p.QueueMessage(msg)
|
||||||
@ -749,7 +749,7 @@ func (p *Peer) CatchupWithPeer(blockHash []byte) {
|
|||||||
msg := ethwire.NewMessage(ethwire.MsgGetChainTy, []interface{}{blockHash, uint64(50)})
|
msg := ethwire.NewMessage(ethwire.MsgGetChainTy, []interface{}{blockHash, uint64(50)})
|
||||||
p.QueueMessage(msg)
|
p.QueueMessage(msg)
|
||||||
|
|
||||||
peerlogger.Infof("Requesting blockchain %x... from peer %s\n", p.ethereum.BlockChain().CurrentBlock.Hash()[:4], p.conn.RemoteAddr())
|
peerlogger.DebugDetailf("Requesting blockchain %x... from peer %s\n", p.ethereum.BlockChain().CurrentBlock.Hash()[:4], p.conn.RemoteAddr())
|
||||||
|
|
||||||
msg = ethwire.NewMessage(ethwire.MsgGetTxsTy, []interface{}{})
|
msg = ethwire.NewMessage(ethwire.MsgGetTxsTy, []interface{}{})
|
||||||
p.QueueMessage(msg)
|
p.QueueMessage(msg)
|
||||||
|
Loading…
Reference in New Issue
Block a user