fix: do not attempt to free nil rust trace (#845)

This commit is contained in:
Ömer Faruk Irmak 2024-06-21 14:29:05 +03:00 committed by GitHub
parent aafca83598
commit f40dca0b80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -24,7 +24,7 @@ import (
const (
VersionMajor = 5 // Major version component of the current release
VersionMinor = 4 // Minor version component of the current release
VersionPatch = 7 // Patch version component of the current release
VersionPatch = 8 // Patch version component of the current release
VersionMeta = "mainnet" // Version metadata to append to the version string
)

View file

@ -368,7 +368,7 @@ func (p *Pipeline) encodeStage(traces <-chan *BlockCandidate) <-chan *BlockCandi
encodeTimer.UpdateSince(encodeStart)
stallStart := time.Now()
if sendCancellable(downstreamCh, trace, p.ctx.Done()) {
if sendCancellable(downstreamCh, trace, p.ctx.Done()) && trace.RustTrace != nil {
// failed to send the trace downstream, free it here.
circuitcapacitychecker.FreeRustTrace(trace.RustTrace)
}