More if not needed

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2019-10-13 03:05:43 +02:00
parent c63eca1e45
commit 68db93b62e
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA
2 changed files with 6 additions and 9 deletions

View File

@ -55,9 +55,7 @@ func (sm *StateManager) TipSetState(ctx context.Context, ts *types.TipSet) (cid.
cached, ok := sm.stCache[ck]
sm.stlk.Unlock()
if ok {
if span.IsRecordingEvents() {
span.AddAttributes(trace.BoolAttribute("cache", true))
}
span.AddAttributes(trace.BoolAttribute("cache", true))
return cached[0], cached[1], nil
}

View File

@ -613,12 +613,11 @@ func (syncer *Syncer) verifyBlsAggregate(sig types.Signature, msgs []cid.Cid, pu
func (syncer *Syncer) collectHeaders(ctx context.Context, from *types.TipSet, to *types.TipSet) ([]*types.TipSet, error) {
ctx, span := trace.StartSpan(ctx, "collectHeaders")
defer span.End()
if span.IsRecordingEvents() {
span.AddAttributes(
trace.Int64Attribute("fromHeight", int64(from.Height())),
trace.Int64Attribute("toHeight", int64(to.Height())),
)
}
span.AddAttributes(
trace.Int64Attribute("fromHeight", int64(from.Height())),
trace.Int64Attribute("toHeight", int64(to.Height())),
)
blockSet := []*types.TipSet{from}