Skip to content

Commit 4ca5272

Browse files
authored
core: use internal context for sending traces (ethereum#755)
1 parent 9859f2d commit 4ca5272

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/blockchain.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ func (bc *BlockChain) writeBlockAndSetHead(ctx context.Context, block *types.Blo
13881388

13891389
var reorg bool
13901390

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

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

14321432
// Set new head.
14331433
if status == CanonStatTy {
1434-
tracing.Exec(ctx, "blockchain.writeHeadBlock", func(_ context.Context, _ trace.Span) {
1434+
tracing.Exec(writeBlockAndSetHeadCtx, "blockchain.writeHeadBlock", func(_ context.Context, _ trace.Span) {
14351435
bc.writeHeadBlock(block)
14361436
})
14371437
}

0 commit comments

Comments
 (0)