Skip to content

Commit

Permalink
print code optimization
Browse files Browse the repository at this point in the history
1. delete useless break
2. add node id prints when io.EOF exception happens.
3. change one warning to debug, since most of the time
   it is just a sign of end of cache.

Signed-off-by: Jin Qing <[email protected]>
  • Loading branch information
superJinQing authored and dreamfly281 committed Jul 28, 2017
1 parent 3da9692 commit f9e7513
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/store/ChainStore/ChainStore.go
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ func (bd *ChainStore) persistBlocks(ledger *Ledger) {

block, ok := bd.blockCache[hash]
if !ok {
log.Warn("[persistBlocks]: warn, blockCache not contain key hash.")
log.Debug("[persistBlocks]: debug, blockCache not contain key hash.")
break
}
err := bd.persist(block)
Expand Down
3 changes: 1 addition & 2 deletions net/node/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,8 @@ func (node *node) rx() {
t := time.Now()
node.UpdateRXTime(t)
unpackNodeBuf(node, buf[0:len])
break
case io.EOF:
log.Error("Rx io.EOF ", err)
log.Error("Rx io.EOF: ", err, ", node id is ", node.GetID())
goto DISCONNECT
default:
log.Error("Read connection error ", err)
Expand Down

0 comments on commit f9e7513

Please sign in to comment.