Skip to content

Commit

Permalink
Use Withfields for Forked Block (#2394)
Browse files Browse the repository at this point in the history
* use with fields for forked block

* spacing
  • Loading branch information
terencechain authored and nisdas committed Apr 27, 2019
1 parent 6ddb5fa commit 7a04af7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion beacon-chain/sync/receive_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/prysmaticlabs/prysm/shared/hashutil"
"github.com/prysmaticlabs/prysm/shared/p2p"
"github.com/prysmaticlabs/prysm/shared/params"
"github.com/sirupsen/logrus"
"go.opencensus.io/trace"
)

Expand Down Expand Up @@ -193,7 +194,10 @@ func (rs *RegularSync) validateAndProcessBlock(
}
} else {
forkedBlock.Inc()
log.Warnf("Received Block from a Forked Chain with root %#x and slot %d", blockRoot, block.Slot)
log.WithFields(logrus.Fields{
"slot": block.Slot,
"root": fmt.Sprintf("%#x", blockRoot)},
).Warn("Received Block from a forked chain")
}

sentBlocks.Inc()
Expand Down

0 comments on commit 7a04af7

Please sign in to comment.