Skip to content

Commit

Permalink
core: use internal context for sending traces (ethereum#755)
Browse files Browse the repository at this point in the history
  • Loading branch information
manav2401 authored Feb 24, 2023
1 parent 9859f2d commit 4ca5272
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,7 @@ func (bc *BlockChain) writeBlockAndSetHead(ctx context.Context, block *types.Blo

var reorg bool

tracing.Exec(ctx, "blockchain.ReorgNeeded", func(_ context.Context, span trace.Span) {
tracing.Exec(writeBlockAndSetHeadCtx, "blockchain.ReorgNeeded", func(_ context.Context, span trace.Span) {
reorg, err = bc.forker.ReorgNeeded(currentBlock.Header(), block.Header())
tracing.SetAttributes(
span,
Expand All @@ -1402,7 +1402,7 @@ func (bc *BlockChain) writeBlockAndSetHead(ctx context.Context, block *types.Blo
return NonStatTy, err
}

tracing.Exec(ctx, "blockchain.reorg", func(_ context.Context, span trace.Span) {
tracing.Exec(writeBlockAndSetHeadCtx, "blockchain.reorg", func(_ context.Context, span trace.Span) {
if reorg {
// Reorganise the chain if the parent is not the head block
if block.ParentHash() != currentBlock.Hash() {
Expand Down Expand Up @@ -1431,7 +1431,7 @@ func (bc *BlockChain) writeBlockAndSetHead(ctx context.Context, block *types.Blo

// Set new head.
if status == CanonStatTy {
tracing.Exec(ctx, "blockchain.writeHeadBlock", func(_ context.Context, _ trace.Span) {
tracing.Exec(writeBlockAndSetHeadCtx, "blockchain.writeHeadBlock", func(_ context.Context, _ trace.Span) {
bc.writeHeadBlock(block)
})
}
Expand Down

0 comments on commit 4ca5272

Please sign in to comment.