Skip to content

Commit

Permalink
Small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
muXxer committed Mar 20, 2024
1 parent 01a3a28 commit 5bffdc9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/protocol/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,9 @@ func (c *Chain) CumulativeVerifiedWeightAt(slot iotago.SlotIndex) uint64 {
func (c *Chain) LatestEngine() *engine.Engine {
currentChain, currentEngine := c, c.Engine.Get()

// traverse the chain upwards until we find an engine
for currentEngine == nil {
// traverse the chain upwards until we find an engine
currentChain = currentChain.ParentChain.Get()
if currentChain == nil {
if currentChain = currentChain.ParentChain.Get(); currentChain == nil {
// no parent chain and therefore no engine found
return nil
}
Expand Down

0 comments on commit 5bffdc9

Please sign in to comment.