vspd: Fix OOB panic in spent ticket scanner.
Range expressions are only evaluated once before beginning a for loop, which makes them unsuitable for loops which manually alter the index.
This commit is contained in:
parent
7d1b7deb01
commit
2af3d4eca7
@ -146,7 +146,7 @@ func (v *vspd) findSpentTickets(toCheck database.TicketList, startHeight int64)
|
|||||||
return nil, 0, err
|
return nil, 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := range tickets {
|
for i := 0; i < len(tickets); i++ {
|
||||||
// The regular transaction tree does not need to be checked because
|
// The regular transaction tree does not need to be checked because
|
||||||
// tickets can only be spent by vote or revoke transactions which
|
// tickets can only be spent by vote or revoke transactions which
|
||||||
// are always in the stake tree.
|
// are always in the stake tree.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user