From 4ca527255b760fd19ddfaadf06c2ee65c189934c Mon Sep 17 00:00:00 2001 From: Manav Darji Date: Fri, 24 Feb 2023 12:52:45 +0530 Subject: [PATCH] core: use internal context for sending traces (#755) --- core/blockchain.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 8fb4035f4b..a66b02065b 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -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, @@ -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() { @@ -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) }) }