mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
make id string only 8byte long for readable logs
This commit is contained in:
parent
621062f653
commit
8566350936
1 changed files with 3 additions and 2 deletions
|
|
@ -97,14 +97,14 @@ func runEthProtocol(txPool txPool, chainManager chainManager, blockPool blockPoo
|
||||||
blockPool: blockPool,
|
blockPool: blockPool,
|
||||||
rw: rw,
|
rw: rw,
|
||||||
peer: peer,
|
peer: peer,
|
||||||
id: fmt.Sprintf("%x", peer.Identity().Pubkey()),
|
id: fmt.Sprintf("%x", peer.Identity().Pubkey()[:8]),
|
||||||
}
|
}
|
||||||
err = self.handleStatus()
|
err = self.handleStatus()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
for {
|
for {
|
||||||
err = self.handle()
|
err = self.handle()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Printf("handle err %v", err)
|
||||||
self.blockPool.RemovePeer(self.id)
|
self.blockPool.RemovePeer(self.id)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
@ -118,6 +118,7 @@ func (self *ethProtocol) handle() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
fmt.Printf("handle err %v", err)
|
||||||
if msg.Size > ProtocolMaxMsgSize {
|
if msg.Size > ProtocolMaxMsgSize {
|
||||||
return self.protoError(ErrMsgTooLarge, "%v > %v", msg.Size, ProtocolMaxMsgSize)
|
return self.protoError(ErrMsgTooLarge, "%v > %v", msg.Size, ProtocolMaxMsgSize)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue