@@ -408,7 +408,7 @@ func (c *Chain) produceBlock(now time.Time) (err error) {
408408 // Advise new block to the other peers
409409 req := & MuxAdviseNewBlockReq {
410410 Envelope : proto.Envelope {
411- // TODO(leventeliu): Add
411+ // TODO(leventeliu): Add fields.
412412 },
413413 DatabaseID : c .rt .databaseID ,
414414 AdviseNewBlockReq : AdviseNewBlockReq {
@@ -421,7 +421,8 @@ func (c *Chain) produceBlock(now time.Time) (err error) {
421421 for _ , p := range c .rt .peers .Servers {
422422 if p .ID != c .rt .server .ID {
423423 if err = c .cl .CallNode (p .ID , method , req , resp ); err != nil {
424- log .Errorf ("Failed to advise now block to node %s" , string (p .ID ))
424+ log .WithField ("node" , string (p .ID )).WithError (err ).Errorln (
425+ "Failed to advise new block" )
425426 }
426427 }
427428 }
@@ -438,7 +439,8 @@ func (c *Chain) runCurrentTurn(now time.Time) {
438439 }
439440
440441 if err := c .produceBlock (now ); err != nil {
441- log .Errorf ("Failed to produce block: err = %v, now = %s" , err , now .Format (time .RFC3339Nano ))
442+ log .WithField ("now" , now .Format (time .RFC3339Nano )).WithError (err ).Errorln (
443+ "Failed to produce block" )
442444 }
443445}
444446
@@ -493,7 +495,6 @@ func (c *Chain) Start() (err error) {
493495// Stop stops the main process of the sql-chain.
494496func (c * Chain ) Stop () (err error ) {
495497 // Stop main process
496- log .Debugf ("chain stopping: %p" , c )
497498 c .rt .stop ()
498499
499500 // Close database file
0 commit comments