Skip to content

Commit a9c7035

Browse files
correctly determine leaf index
1 parent aa2cd0c commit a9c7035

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bridgesync/processor.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,9 +1311,9 @@ func (p *processor) ProcessBlock(ctx context.Context, block sync.Block) error {
13111311
return fmt.Errorf("NewDepositCount=%d exceeds uint32 max (%d)", newDepositCountU64, uint32(math.MaxUint32))
13121312
}
13131313

1314-
newDepositCountU32 := uint32(newDepositCountU64)
1315-
if err := p.exitTree.BackwardToIndex(ctx, tx, newDepositCountU32); err != nil {
1316-
p.log.Errorf("failed to backward local exit tree to %d deposit count", newDepositCountU32)
1314+
leafIndex := uint32(newDepositCountU64 - 1)
1315+
if err := p.exitTree.BackwardToIndex(ctx, tx, leafIndex); err != nil {
1316+
p.log.Errorf("failed to backward local exit tree to %d deposit count", leafIndex)
13171317
return err
13181318
}
13191319

0 commit comments

Comments
 (0)