core/txpool/blobpool: move conversion into method

This commit is contained in:
Felix Lange 2025-09-22 21:50:27 +02:00
parent f8d56b9e39
commit ffc9d69cb2

View file

@ -903,7 +903,12 @@ func (p *BlobPool) Reset(oldHead, newHead *types.Header) {
} }
// Initiate the background conversion thread, the mutex is not required // Initiate the background conversion thread, the mutex is not required
// and won't block any pool operation. // and won't block any pool operation.
go func() { go p.convertLegacySidecars(txs)
}
}
// convertLegacySidecars converts all given transactions to sidecar version 1.
func (p *BlobPool) convertLegacySidecars(txs map[common.Address]map[uint64]uint64) {
var ( var (
start = time.Now() start = time.Now()
success int success int
@ -948,12 +953,11 @@ func (p *BlobPool) Reset(oldHead, newHead *types.Header) {
} }
} }
} }
if p.sidecarMigrationDoneCh != nil { if p.sidecarMigrationDoneCh != nil {
close(p.sidecarMigrationDoneCh) close(p.sidecarMigrationDoneCh)
} }
log.Info("Completed the blob transaction conversion", "discarded", fail, "injected", success, "elapsed", common.PrettyDuration(time.Since(start))) log.Info("Completed the blob transaction conversion", "discarded", fail, "injected", success, "elapsed", common.PrettyDuration(time.Since(start)))
}()
}
} }
// reorg assembles all the transactors and missing transactions between an old // reorg assembles all the transactors and missing transactions between an old